mirror of
https://github.com/red-data-tools/YouPlot.git
synced 2025-05-06 07:10:10 +08:00
Improved README
This commit is contained in:
parent
dee53a003c
commit
0af084916e
114
README.md
114
README.md
@ -15,16 +15,20 @@ Create ASCII charts on the terminal with data from standard streams in the pipel
|
|||||||
gem install youplot
|
gem install youplot
|
||||||
```
|
```
|
||||||
|
|
||||||
## Screenshots
|
## Quick Start
|
||||||
|
|
||||||
**histogram**
|
### barplot
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
ruby -r numo/narray -e "puts Numo::DFloat.new(1000).rand_norm.to_a" \
|
curl -sL https://git.io/ISLANDScsv \
|
||||||
| uplot hist --nbins 15
|
| sort -nk2 -t, \
|
||||||
|
| tail \
|
||||||
|
| uplot bar -d, -t "Areas of the World's Major Landmasses"
|
||||||
```
|
```
|
||||||
|
|
||||||
<img src="https://i.imgur.com/wpsoGJq.png" width="75%" height="75%">
|

|
||||||
|
|
||||||
|
### histogram
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
echo -e "from numpy import random;" \
|
echo -e "from numpy import random;" \
|
||||||
@ -34,90 +38,65 @@ echo -e "from numpy import random;" \
|
|||||||
| uplot hist --nbins 20
|
| uplot hist --nbins 20
|
||||||
```
|
```
|
||||||
|
|
||||||
<img src="https://i.imgur.com/97R2MQx.png" width="75%" height="75%">
|

|
||||||
|
|
||||||
**scatter**
|
### lineplot
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -s https://raw.githubusercontent.com/uiuc-cse/data-fa14/gh-pages/data/iris.csv \
|
curl -sL https://git.io/AirPassengers \
|
||||||
| cut -f1-4 -d, \
|
| cut -f2,3 -d, \
|
||||||
| uplot scatter -H -d, -t IRIS
|
| uplot line -d, -w 50 -h 15 -t AirPassengers --xlim 1950,1960 --ylim 0,600
|
||||||
```
|
```
|
||||||
|
|
||||||
<img src="https://i.imgur.com/STX7bFT.png" width="75%" height="75%">
|

|
||||||
|
|
||||||
**line**
|
### scatter
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -s https://www.mhlw.go.jp/content/pcr_positive_daily.csv \
|
curl -sL https://git.io/YouPlotIris \
|
||||||
| cut -f2 -d, \
|
| cut -f1-4 \
|
||||||
| uplot line -w 50 -h 15 -t 'PCR positive tests' --xlabel Date --ylabel number
|
| uplot scatter -H -t IRIS
|
||||||
```
|
```
|
||||||
|
|
||||||
<img src="https://i.imgur.com/PVl5dsa.png" width="75%" height="75%">
|

|
||||||
|
|
||||||
**box**
|
### density
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -s https://raw.githubusercontent.com/uiuc-cse/data-fa14/gh-pages/data/iris.csv \
|
curl -sL https://git.io/YouPlotIris \
|
||||||
| cut -f1-4 -d, \
|
| cut -f1-4 \
|
||||||
| uplot box -H -d, -t IRIS
|
| uplot density -H -t IRIS
|
||||||
```
|
```
|
||||||
|
|
||||||
<img src="https://i.imgur.com/sNI4SmN.png" width="75%" height="75%">
|

|
||||||
|
|
||||||
**colors**
|
### boxplot
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
uplot colors
|
curl -sL https://git.io/YouPlotIris \
|
||||||
|
| cut -f1-4 \
|
||||||
|
| uplot boxplot -H -t IRIS
|
||||||
```
|
```
|
||||||
|
|
||||||
<img src="https://i.imgur.com/LxyHQsz.png">
|

|
||||||
|
|
||||||
|
### count
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -sL https://git.io/TITANICcsv \
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Note: `count` is slower than other Unix commands because it runs in a Ruby script.
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
`uplot --help`
|
### file
|
||||||
|
|
||||||
```
|
### stream
|
||||||
Program: YouPlot (Tools for plotting on the terminal)
|
|
||||||
Version: 0.2.7 (using UnicodePlot 0.0.4)
|
|
||||||
Source: https://github.com/kojix2/youplot
|
|
||||||
|
|
||||||
Usage: uplot <command> [options] <in.tsv>
|
### help
|
||||||
|
|
||||||
Commands:
|
|
||||||
barplot bar
|
|
||||||
histogram hist
|
|
||||||
lineplot line
|
|
||||||
lineplots lines
|
|
||||||
scatter s
|
|
||||||
density d
|
|
||||||
boxplot box
|
|
||||||
colors show the list of available colors
|
|
||||||
|
|
||||||
count c baplot based on the number of occurrences
|
|
||||||
(slower than `sort | uniq -c | sort -n -k1`)
|
|
||||||
|
|
||||||
Options:
|
|
||||||
-O, --pass [VAL] file to output standard input data to [stdout]
|
|
||||||
for inserting YouPlot 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 transpose the axes of the input data
|
|
||||||
-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...
|
|
||||||
```
|
|
||||||
|
|
||||||
Use `--help` to print command-specific options.
|
Use `--help` to print command-specific options.
|
||||||
|
|
||||||
@ -135,6 +114,13 @@ Options:
|
|||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### colors
|
||||||
|
|
||||||
|
```sh
|
||||||
|
uplot colors
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
Let's keep it simple.
|
Let's keep it simple.
|
||||||
|
Loading…
Reference in New Issue
Block a user