mkaz / termgraph

a python command-line tool which draws basic graphs in the terminal
MIT License
3.14k stars 165 forks source link

Make plot histogram #51

Closed HiromuIshikawa closed 4 years ago

HiromuIshikawa commented 4 years ago

This PR is implementation for #50 Issue that is submit by me.

I add --histogram option to plot histogram.

Example: data/histogram.dat is normal random data that has 10,000 rows. Mean: 50, Sigma: 10

0,33.506743485904806
1,59.97686169880076
2,48.97163876965883
3,45.77879478335551
4,33.66231157524573
.
.
.
9996,53.237398789002064
9997,68.18660004559298
9998,61.85231491289563
9999,43.374266043226164

When input

termgraph/termgraph.py --histogram data/histogram.dat --bins 10 --color blue 

output is as follow: スクリーンショット 2019-12-01 14 17 41

--bins option is num of bars