{"id":13595964,"url":"https://github.com/red-data-tools/YouPlot","last_synced_at":"2025-04-09T13:33:52.883Z","repository":{"id":45228655,"uuid":"283230219","full_name":"red-data-tools/YouPlot","owner":"red-data-tools","description":"A command line tool that draw plots on the terminal.","archived":false,"fork":false,"pushed_at":"2024-12-26T00:02:39.000Z","size":548,"stargazers_count":4338,"open_issues_count":16,"forks_count":57,"subscribers_count":21,"default_branch":"main","last_synced_at":"2025-04-08T21:11:44.993Z","etag":null,"topics":["cli","csv","ruby","terminal","tsv","tui","visualization"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/red-data-tools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"kojix2"}},"created_at":"2020-07-28T14:05:15.000Z","updated_at":"2025-04-08T18:59:36.000Z","dependencies_parsed_at":"2023-11-15T11:37:38.441Z","dependency_job_id":"d3489019-83ec-470e-a8cc-b93f5f39440c","html_url":"https://github.com/red-data-tools/YouPlot","commit_stats":{"total_commits":366,"total_committers":4,"mean_commits":91.5,"dds":0.008196721311475419,"last_synced_commit":"1a3a80568d54ec6a8ef9aa7cc76203545d252dd9"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red-data-tools%2FYouPlot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red-data-tools%2FYouPlot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red-data-tools%2FYouPlot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red-data-tools%2FYouPlot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/red-data-tools","download_url":"https://codeload.github.com/red-data-tools/YouPlot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248049796,"owners_count":21039275,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","csv","ruby","terminal","tsv","tui","visualization"],"created_at":"2024-08-01T16:02:02.672Z","updated_at":"2025-04-09T13:33:52.863Z","avatar_url":"https://github.com/red-data-tools.png","language":"Ruby","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"logo.svg\"\u003e\n  \u003chr\u003e\n  \u003ca href=\"https://github.com/red-data-tools/YouPlot/actions/workflows/ci.yml\"\u003e\u003cimg alt=\"Build Status\" src=\"https://github.com/red-data-tools/YouPlot/workflows/test/badge.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://rubygems.org/gems/youplot/\"\u003e\u003cimg alt=\"Gem Version\" src=\"https://badge.fury.io/rb/youplot.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://zenodo.org/badge/latestdoi/283230219\"\u003e\u003cimg alt=\"DOI\" src=\"https://zenodo.org/badge/283230219.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://rubydoc.info/gems/youplot/\"\u003e\u003cimg alt=\"Docs Stable\" src=\"https://img.shields.io/badge/docs-stable-blue.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"LICENSE.txt\"\u003e\u003cimg alt=\"The MIT License\" src=\"https://img.shields.io/badge/license-MIT-blue.svg\"\u003e\u003c/a\u003e\n  \n  YouPlot is a command line tool that draws plots on the terminal.\n\n  :bar_chart: Powered by [UnicodePlot](https://github.com/red-data-tools/unicode_plot.rb)\n\u003c/div\u003e\n\n## Installation\n\n```\nbrew install youplot\n```\n\n```\ngem install youplot\n```\n\n```\nnix shell nixpkgs#youplot\n```\n\n```\nguix install youplot\n```\n\n```\nconda install -c conda-forge ruby\nconda install -c conda-forge compilers\ngem install youplot\n```\n\n## Quick Start\n\n\u003cimg alt=\"barplot\" src=\"https://user-images.githubusercontent.com/5798442/101999903-d36a2d00-3d24-11eb-9361-b89116f44122.png\" width=160\u003e \u003cimg alt=\"histogram\" src=\"https://user-images.githubusercontent.com/5798442/101999820-21cafc00-3d24-11eb-86db-e410d19b07df.png\" width=160\u003e \u003cimg alt=\"scatter\" src=\"https://user-images.githubusercontent.com/5798442/101999827-27284680-3d24-11eb-9903-551857eaa69c.png\" width=160\u003e \u003cimg alt=\"density\" src=\"https://user-images.githubusercontent.com/5798442/101999828-2abbcd80-3d24-11eb-902c-2f44266fa6ae.png\" width=160\u003e \u003cimg alt=\"boxplot\" src=\"https://user-images.githubusercontent.com/5798442/101999830-2e4f5480-3d24-11eb-8891-728c18bf5b35.png\" width=160\u003e\n\n`uplot \u003ccommand\u003e [options] \u003cdata.tsv\u003e`\n\n### barplot\n\n```sh\ncurl -sL https://git.io/ISLANDScsv \\\n| sort -nk2 -t, \\\n| tail -n15 \\\n| uplot bar -d, -t \"Areas of the World's Major Landmasses\"\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"barplot\" src=\"https://user-images.githubusercontent.com/5798442/101999903-d36a2d00-3d24-11eb-9361-b89116f44122.png\"\u003e\n\u003c/p\u003e\n\n\n\n```sh\n# For offline user: Sorts files in a directory by size and shows a bar graph.\nls -l | awk '{print $9, $5}' | sort -nk 2 | uplot bar -d ' '\n```\n\n### histogram\n\n```sh\necho -e \"from numpy import random;\" \\\n        \"n = random.randn(10000);\"  \\\n        \"print('\\\\\\n'.join(str(i) for i in n))\" \\\n| python3 \\\n| uplot hist --nbins 20\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"histogram\" src=\"https://user-images.githubusercontent.com/5798442/101999820-21cafc00-3d24-11eb-86db-e410d19b07df.png\"\u003e\n\u003c/p\u003e\n\n### lineplot\n\n```sh\ncurl -sL https://git.io/AirPassengers \\\n| cut -f2,3 -d, \\\n| uplot line -d, -w 50 -h 15 -t AirPassengers --xlim 1950,1960 --ylim 0,600\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"lineplot\" src=\"https://user-images.githubusercontent.com/5798442/101999825-24c5ec80-3d24-11eb-99f4-c642e8d221bc.png\"\u003e\n\u003c/p\u003e\n\n```sh\n# For offline users: Calculates sin values (0-2*pi) and plots a sine wave.\npython3 -c '\nfrom math import sin, pi\ndata = \"\\n\".join(f\"{i*pi/50}\\t{sin(i*pi/50)}\" for i in range(101))\nprint(data)' | uplot line\n```\n\n### scatter\n\n```sh\ncurl -sL https://git.io/IRIStsv \\\n| cut -f1-4 \\\n| uplot scatter -H -t IRIS\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"scatter\" src=\"https://user-images.githubusercontent.com/5798442/101999827-27284680-3d24-11eb-9903-551857eaa69c.png\"\u003e\n\u003c/p\u003e\n\n\n```sh\n# For offline users\ncat test/fixtures/iris.csv | cut -f1-4 -d, | uplot scatter -H -d, -t IRIS\n```\n\n### density\n\n```sh\ncurl -sL https://git.io/IRIStsv \\\n| cut -f1-4 \\\n| uplot density -H -t IRIS\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"density\" src=\"https://user-images.githubusercontent.com/5798442/101999828-2abbcd80-3d24-11eb-902c-2f44266fa6ae.png\"\u003e\n\u003c/p\u003e\n\n```sh\n# For offline users\ncat test/fixtures/iris.csv | cut -f1-4 -d, | uplot density -H -d, -t IRIS\n```\n\n### boxplot\n\n```sh\ncurl -sL https://git.io/IRIStsv \\\n| cut -f1-4 \\\n| uplot boxplot -H -t IRIS\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"boxplot\" src=\"https://user-images.githubusercontent.com/5798442/101999830-2e4f5480-3d24-11eb-8891-728c18bf5b35.png\"\u003e\n\u003c/p\u003e\n\n```sh\n# For offline users\ncat test/fixtures/iris.csv | cut -f1-4 -d, | uplot boxplot -H -d, -t IRIS\n```\n\n### count\n\nCount processes by user ID.\n\n```sh\nps aux | awk '{print $1}' | uplot count\n```\n\nCount the number of chromosomes where genes are located. \n\n```sh\ncat gencode.v35.annotation.gff3 \\\n| grep -v '#' | grep 'gene' | cut -f1 \\\n| uplot count -t \"The number of human gene annotations per chromosome\"  -c blue\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"count\" src=\"https://user-images.githubusercontent.com/5798442/101999832-30b1ae80-3d24-11eb-96fe-e5000bed1f5c.png\"\u003e\n\u003c/p\u003e\n\n* [GENCODE - Human Release](https://www.gencodegenes.org/human/)\n\nNote: `count` is not very fast because it runs in a Ruby script.\nThis is fine in most cases, as long as the data size is small. If you want to visualize huge data, it is faster to use a combination of common Unix commands as shown below.\n\n```sh\ncat gencode.v35.annotation.gff3 | grep -v '#' | grep 'gene' | cut -f1 \\\n| sort | uniq -c | sort -nrk1 \\\n| uplot bar --fmt yx -d ' ' -t \"The number of human gene annotations per chromosome\"  -c blue\n```\n\n## Usage\n\n### Commands\n\n`uplot` is the shortened form of `youplot`. You can use either.\n\n| Command                                        | Description                       |\n|------------------------------------------------|-----------------------------------|\n| `cat data.tsv \\| uplot \u003ccommand\u003e [options]`    | Take input from stdin             |\n| `uplot \u003ccommand\u003e [options] data.tsv ...`       | Take input from files             |\n| `pipeline1 \\| uplot \u003ccommand\u003e -O \\| pipeline2` | Outputs data from stdin to stdout |\n\n### Subcommands\n\nThe following sub-commands are available.\n\n| command   | short | how it works                           |\n|-----------|-------|----------------------------------------|\n| barplot   | bar   | draw a horizontal barplot              |\n| histogram | hist  | draw a horizontal histogram            |\n| lineplot  | line  | draw a line chart                      |\n| lineplots | lines | draw a line chart with multiple series |\n| scatter   | s     | draw a scatter plot                    |\n| density   | d     | draw a density plot                    |\n| boxplot   | box   | draw a horizontal boxplot              |\n|           |       |                                        |\n| count     | c     | draw a barplot based on the number of occurrences (slow) |\n|           |       |                                        |\n| colors    | color | show the list of available colors      |\n\n### Output the plot\n\n* `-o`\n  * By default, the plot is output to **standard error output**.\n  * If you want to output to standard output, Use hyphen ` -o -` or no argument `uplot s -o | `.\n\n### Output the input data\n\n* `-O`\n  * By default, the input data is not shown anywhere.\n  * If you want to pass the input data directly to the standard output, Use hyphen `-O -` or no argument `uplot s -O |`.\n  * This is useful when passing data to a subsequent pipeline.\n\n### Header\n\n* `-H`\n  * If input data contains a header line, you need to specify the `-H` option.\n\n### Delimiter\n\n* `-d`\n  * You do not need to use `-d` option for tab-delimited text since the default value is tab.\n  * To specify a blank space, you can use `uplot bar -d ' ' data.txt`. \n\n### Real-time data\n\n* `-p` `--progress`\n  * Experimental progressive mode is currently under development.\n  * `ruby -e 'loop{puts rand(100)}' | uplot line --progress`\n\n### Show detailed options for subcommands\n\n* `--help`\n  * The `--help` option will show more detailed options for each subcommand.\n  * `uplot hist --help`\n\n### Set columns as x-axis or y-axis\n\n* YouPlot treats the first column as the X axis and the second column as the Y axis. When working with multiple series, the first column is the X axis, the second column is series Y1, the third column is series Y2, and so on. \n* If you pass only one column of data for `line` and `bar`, YouPlot will automatically use a sequential number starting from 1 as the X-axis. \n\n* `--fmt`\n  * `--fmt xyy` `--fmt xyxy` `--fmt yx` options give you a few more choices. See `youplot \u003ccommand\u003e --help` for more details. \n  * The fmt option may be renamed in the future. \n  * The `-x` and `-y` options might be used to specify columns in the future.\n\n* Use `awk '{print $2, $1}'` to swap columns. Use `paste` to concatenate series.\n\n### Categorical data\n\n* With GNU datamash, you can manage to handle categorized data. \n  * `cat test/fixtures/iris.csv | sed '/^$/d' | datamash --header-in --output-delimiter=: -t, -g5 collapse 3,4 | cut -f2-3 -d: | sed 's/:/\\n/g' | uplot s -d, -T --fmt xyxy`\n  * This is not so easy...\n\n### Time series\n\n* Not yet supported.\n\n### YouPlot Configuration (youplotrc)\n\nYou can specify default options in a configuration file in YAML format. For more information, enter the following command.\n\n```\nuplot --config\n```\n\n## Tools that are useful to use with YouPlot\n\n* [csvtk](https://github.com/shenwei356/csvtk)\n* [GNU datamash](https://www.gnu.org/software/datamash/)\n* [awk](https://www.gnu.org/software/gawk/)\n* [xsv](https://github.com/BurntSushi/xsv)\n\n## Contributing\n\nYouPlot is a library under development, so even small improvements like typofix are welcome!\nPlease feel free to send us your pull requests.\n\n* [Report bugs](https://github.com/red-data-tools/YouPlot/issues)\n* Fix bugs and [submit pull requests](https://github.com/red-data-tools/YouPlot/pulls)\n* Write, clarify, or fix documentation\n  * English corrections by native speakers are welcome.\n* Suggest or add new features\n* Make a donation\n\n### Development\n\n```sh\n# fork the main repository by clicking the Fork button. \ngit clone https://github.com/your_name/YouPlot\nbundle install             # Install the gem dependencies\nbundle exec rake test      # Run the test\nbundle exec rake install   # Installation from source code\nbundle exec exe/uplot      # Run youplot (Try out the edited code)\n```\n\n    Do you need commit rights to my repository?\n    Do you want to get admin rights and take over the project?\n    If so, please feel free to contact us.\n\n### Acknowledgements\n\n* [sampo grafiikka](https://jypg.net/sampo_grafiikka) - Project logo creation\n* [yutaas](https://github.com/yutaas) - English proofreading\n\n## License\n\n[MIT License](https://opensource.org/licenses/MIT).\n","funding_links":["https://ko-fi.com/kojix2"],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fred-data-tools%2FYouPlot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fred-data-tools%2FYouPlot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fred-data-tools%2FYouPlot/lists"}