Skip to content

Commit b3a23a2

Browse files
committed
Improve shell portability of README
1 parent 86bf585 commit b3a23a2

1 file changed

Lines changed: 33 additions & 27 deletions

File tree

‎README.md‎

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,9 @@ curl -sL https://git.io/ISLANDScsv \
5656
<img alt="barplot" src="https://user-images.githubusercontent.com/5798442/101999903-d36a2d00-3d24-11eb-9361-b89116f44122.png">
5757
</p>
5858

59-
59+
For offline users: sorts files in a directory by size and shows a bar graph.
6060

6161
```sh
62-
# For offline user: Sorts files in a directory by size and shows a bar graph.
6362
ls -l | awk '{print $9, $5}' | sort -nk 2 | uplot bar -d ' '
6463
```
6564

@@ -89,12 +88,15 @@ curl -sL https://git.io/AirPassengers \
8988
<img alt="lineplot" src="https://user-images.githubusercontent.com/5798442/101999825-24c5ec80-3d24-11eb-99f4-c642e8d221bc.png">
9089
</p>
9190

91+
For offline users: calculates sin values from 0 to 2*pi and plots a sine wave.
92+
9293
```sh
93-
# For offline users: Calculates sin values (0-2*pi) and plots a sine wave.
94-
python3 -c '
94+
python3 - <<'PY' | uplot line
9595
from math import sin, pi
96-
data = "\n".join(f"{i*pi/50}\t{sin(i*pi/50)}" for i in range(101))
97-
print(data)' | uplot line
96+
97+
for i in range(101):
98+
print(f"{i*pi/50}\t{sin(i*pi/50)}")
99+
PY
98100
```
99101

100102
### scatter
@@ -110,8 +112,9 @@ curl -sL https://git.io/IRIStsv \
110112
</p>
111113

112114

115+
For offline users:
116+
113117
```sh
114-
# For offline users
115118
cat test/fixtures/iris.csv | cut -f1-4 -d, | uplot scatter -H -d, -t IRIS
116119
```
117120

@@ -127,8 +130,9 @@ curl -sL https://git.io/IRIStsv \
127130
<img alt="density" src="https://user-images.githubusercontent.com/5798442/101999828-2abbcd80-3d24-11eb-902c-2f44266fa6ae.png">
128131
</p>
129132

133+
For offline users:
134+
130135
```sh
131-
# For offline users
132136
cat test/fixtures/iris.csv | cut -f1-4 -d, | uplot density -H -d, -t IRIS
133137
```
134138

@@ -144,8 +148,9 @@ curl -sL https://git.io/IRIStsv \
144148
<img alt="boxplot" src="https://user-images.githubusercontent.com/5798442/101999830-2e4f5480-3d24-11eb-8891-728c18bf5b35.png">
145149
</p>
146150

151+
For offline users:
152+
147153
```sh
148-
# For offline users
149154
cat test/fixtures/iris.csv | cut -f1-4 -d, | uplot boxplot -H -d, -t IRIS
150155
```
151156

@@ -187,7 +192,7 @@ cat gencode.v35.annotation.gff3 | grep -v '#' | grep 'gene' | cut -f1 \
187192
`uplot` is the shortened form of `youplot`. You can use either.
188193

189194
| Command | Description |
190-
|------------------------------------------------|-----------------------------------|
195+
| ---------------------------------------------- | --------------------------------- |
191196
| `cat data.tsv \| uplot <command> [options]` | Take input from stdin |
192197
| `uplot <command> [options] data.tsv ...` | Take input from files |
193198
| `pipeline1 \| uplot <command> -O \| pipeline2` | Outputs data from stdin to stdout |
@@ -196,19 +201,19 @@ cat gencode.v35.annotation.gff3 | grep -v '#' | grep 'gene' | cut -f1 \
196201

197202
The following sub-commands are available.
198203

199-
| command | short | how it works |
200-
|-----------|-------|----------------------------------------|
201-
| barplot | bar | draw a horizontal barplot |
202-
| histogram | hist | draw a horizontal histogram |
203-
| lineplot | line | draw a line chart |
204-
| lineplots | lines | draw a line chart with multiple series |
205-
| scatter | s | draw a scatter plot |
206-
| density | d | draw a density plot |
207-
| boxplot | box | draw a horizontal boxplot |
208-
| | | |
204+
| command | short | how it works |
205+
| --------- | ----- | -------------------------------------------------------- |
206+
| barplot | bar | draw a horizontal barplot |
207+
| histogram | hist | draw a horizontal histogram |
208+
| lineplot | line | draw a line chart |
209+
| lineplots | lines | draw a line chart with multiple series |
210+
| scatter | s | draw a scatter plot |
211+
| density | d | draw a density plot |
212+
| boxplot | box | draw a horizontal boxplot |
213+
| | | |
209214
| count | c | draw a barplot based on the number of occurrences (slow) |
210-
| | | |
211-
| colors | color | show the list of available colors |
215+
| | | |
216+
| colors | color | show the list of available colors |
212217

213218
### Output the plot
214219

@@ -297,13 +302,14 @@ Please feel free to send us your pull requests.
297302

298303
### Development
299304

305+
Fork the main repository by clicking the Fork button.
306+
300307
```sh
301-
# fork the main repository by clicking the Fork button.
302308
git clone https://github.com/your_name/YouPlot
303-
bundle install # Install the gem dependencies
304-
bundle exec rake test # Run the test
305-
bundle exec rake install # Installation from source code
306-
bundle exec exe/uplot # Run youplot (Try out the edited code)
309+
bundle install
310+
bundle exec rake test
311+
bundle exec rake install
312+
bundle exec exe/uplot
307313
```
308314

309315
Do you need commit rights to my repository?

0 commit comments

Comments
 (0)