A command line tool that draw plots on the terminal.
Go to file
2020-11-06 10:21:36 +09:00
.github Update README 2020-08-15 23:47:23 +09:00
exe Rubocop auto correct 2020-09-19 00:08:09 +09:00
lib Fix color command option 2020-11-06 10:21:36 +09:00
test Removed file name extensions 2020-11-06 10:00:55 +09:00
.gitignore Update .gitignore 2020-08-03 09:42:55 +09:00
.travis.yml Configure travis.yml 2020-07-29 11:55:11 +09:00
Gemfile Rubocop auto correct 2020-09-19 00:08:09 +09:00
LICENSE.txt first plot 2020-07-28 23:07:15 +09:00
Rakefile Rubocop auto correct 2020-09-19 00:08:09 +09:00
README.md Update README.md 2020-11-04 16:08:34 +09:00
uplot.gemspec Drop support for ruby 2.3 2020-10-10 23:18:27 +09:00

uplot

Build Status Gem Version Docs Latest The MIT License

Create ASCII charts on the terminal with data from standard streams in the pipeline.

📊 Powered by UnicodePlot

Installation

gem install u-plot

Note the hyphen between u and the plot.

Screenshots

histogram

ruby -r numo/narray -e "puts Numo::DFloat.new(1000).rand_norm.to_a" \
  | uplot hist --nbins 15
echo -e "from numpy import random;" \
        "n = random.randn(10000);"  \
        "print('\\\n'.join(str(i) for i in n))" \
| python \
| uplot hist --nbins 20

scatter

curl -s https://raw.githubusercontent.com/uiuc-cse/data-fa14/gh-pages/data/iris.csv \
| cut -f1-4 -d, \
| uplot scatter -H -d, -t IRIS

line

curl -s https://www.mhlw.go.jp/content/pcr_positive_daily.csv \
| cut -f2 -d, \
| uplot line -w 50 -h 15 -t 'PCR positive tests' --xlabel Date --ylabel number

box

curl -s https://raw.githubusercontent.com/uiuc-cse/data-fa14/gh-pages/data/iris.csv \
| cut -f1-4 -d, \
| uplot box -H -d, -t IRIS

colors

uplot colors

Usage

uplot --help

Program: uplot (Tools for plotting on the terminal)
Version: 0.2.7 (using UnicodePlot 0.0.4)
Source:  https://github.com/kojix2/uplot

Usage:   uplot <command> [options]

Commands:
    barplot    bar
    histogram  hist
    lineplot   line
    lineplots  lines
    scatter    s
    density    d
    boxplot    box
    colors

Options:
    -O, --pass [VAL]         file to output standard input data to [stdout]
                             for inserting uplot in the middle of Unix pipes
    -o, --output VAL         file to output results to [stderr]
    -d, --delimiter VAL      use DELIM instead of TAB for field delimiter
    -H, --headers            specify that the input has header row
    -T, --transpose
    -t, --title VAL          print string on the top of plot
    -x, --xlabel VAL         print string on the bottom of the plot
    -y, --ylabel VAL         print string on the far left of the plot
    -w, --width VAL          number of characters per row
    -h, --height VAL         number of rows
    -b, --border VAL         specify the style of the bounding box
    -m, --margin VAL         number of spaces to the left of the plot
    -p, --padding VAL        space of the left and right of the plot
    -c, --color VAL          color of the drawing
        --[no-]labels        hide the labels
        --fmt VAL            xyxy : header is like x1, y1, x2, y2, x3, y3...
                             xyy  : header is like x, y1, y2, y2, y3...
        --debug

Development

Let's keep it simple.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/kojix2/uplot.

License

MIT License.