Char plot in Python
Project description
chrplotlib
Plot graphs using chars
install:
$pip install chrplotlib
For the current developer version:
git clone git@github.com:guofei9987/chrplotlib.git
cd chrplotlib
pip install .
example
from chrplotlib import animation
def update_bar(i):
data = 10 * np.random.rand(20)
print(bar(data, label=range(20), max_height=10))
print('\033[{}A'.format(12))
animation(update_func=update_bar, interval=range(100), pause=0.2)
data = 10 * np.random.rand(20)
label = range(20)
print(bar(data))
Print this:
▃▃
▃▃ ▃▃ ██ ▅▅
██ ▇▇ ██ ██ ▇▇ ██
██ ██ ██ ██ ██ ██
██ ██ ▇▇ ▃▃ ██ ██ ██ ██
██ ██ ▄▄ ▅▅ ██ ██ ██ ██ ██ ██ ▃▃
██ ██ ██ ██ ▂▂ ██ ██ ██ ██ ▃▃ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ▄▄ ██ ██ ██ ██ ▂▂ ██ ▇▇ ██
██ ██ ██ ██ ▃▃ ██ ██ ██ ██ ██ ██ ██ ██ ▃▃ ██ ██ ██ ██ ██ ██
print(bar(data=data, label=range(20)))
Print this:
▃▃
▃▃ ▃▃ ██ ▅▅
██ ▇▇ ██ ██ ▇▇ ██
██ ██ ██ ██ ██ ██
██ ██ ▇▇ ▃▃ ██ ██ ██ ██
██ ██ ▄▄ ▅▅ ██ ██ ██ ██ ██ ██ ▃▃
██ ██ ██ ██ ▂▂ ██ ██ ██ ██ ▃▃ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ▄▄ ██ ██ ██ ██ ▂▂ ██ ▇▇ ██
██ ██ ██ ██ ▃▃ ██ ██ ██ ██ ██ ██ ██ ██ ▃▃ ██ ██ ██ ██ ██ ██
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
print(bar(data, kind='bar'))
Get this:
█▌█▌█▌█▌█▌█▌█▌█▌▌
█▌█▌█▌█▌█▌█▌█▌█▌
█▌█▌█▌█▌▋
█▌█▌█▌█▌█
▌
█▌█▌█▌▎
█▌█▌█▌█▌█▌█▌
█▌█▌█▌█▌█▌▌
█▌█▌█▌█▌█▌█▌█▌█▌▍
█▌▋
█▌█▌
█▌█▌█▌█▌█▌█▌█▌█▌█▌▌
█▌█▌█▌▍
▌
█▌█▌█▌█▌█▌█▌█▌█▌
█▌
█▌▎
█▌█▌█▌█▌█▌█▌█▌█▌█▎
█▌█▌
█▌█▌█▌█▌▌
print(bar(data=data, label=range(20), kind='barh'))
Get this:
0 █▌█▌█▌█▌█▌█▌█▌█▌▌
1 █▌█▌█▌█▌█▌█▌█▌█▌
2 █▌█▌█▌█▌▋
3 █▌█▌█▌█▌█
4 ▌
5 █▌█▌█▌▎
6 █▌█▌█▌█▌█▌█▌
7 █▌█▌█▌█▌█▌▌
8 █▌█▌█▌█▌█▌█▌█▌█▌▍
9 █▌▋
10█▌█▌
11█▌█▌█▌█▌█▌█▌█▌█▌█▌▌
12█▌█▌█▌▍
13▌
14█▌█▌█▌█▌█▌█▌█▌█▌
15█▌
16█▌▎
17█▌█▌█▌█▌█▌█▌█▌█▌█▎
18█▌█▌
19█▌█▌█▌█▌▌
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
chrplotlib-0.0.3.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for chrplotlib-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aeaf2147ba85e9d812577ab81a05adda1b94e9dec49d275b2009e2b8d3602ef0 |
|
MD5 | f3c29ee5da3e1ada9452ba63fac3483c |
|
BLAKE2b-256 | 51ed59653ba5c119eb7c123b6f7f740bfa9a5e2a092334e3c96d773c0ac29568 |