Platform-agnostic, customizable sequence plotting in console, offering high GUI suitability
Project description
asciiplot
Platform-agnostic sequence plotting in console, offering various chart appearance configuration options giving rise to an increased GUI suitability
Installation
$pip install asciiplot
Plot Appearance Configuration Options
Set:
- chart height & title
- axes descriptions & tick labels, including the possibility to determine the number of decimal points for float labels
- the color of virtually all chart components, picked from a wide array of shades due to the integration of colored
- consistent margin between consecutive data points to widen your charts
- the chart indentation within its hosting terminal, or whether it ought to be centered in it, respectively
Usage Examples
from asciiplot import asciiize
print(
asciiize(
[1, 1, 2, 3, 5, 8, 13, 21],
height=15,
inter_points_margin=7,
x_axis_tick_labels=list(range(1, 9)),
y_axis_tick_label_decimal_places=0,
x_axis_description='Iteration',
y_axis_description='Value',
title='Fibonacci Sequence',
horizontal_indentation=6
)
)
Fibonacci Sequence
Value
21┤ ╭──
19┤ ╭╯
18┤ ╭╯
16┤ ╭╯
15┤ ╭─╯
13┤ ╭─╯
12┤ ╭─╯
11┤ ╭─╯
9┤ ╭─╯
8┤ ╭──╯
6┤ ╭───╯
5┤ ╭───╯
3┤ ╭─────╯
2┤ ╭─────────╯
1┼───────┬─────╯─┬───────┬───────┬───────┬───────┬───────┬ Iteration
1 2 3 4 5 6 7 8
import numpy as np
from asciiplot import asciiize
print(
asciiize(
np.random.randint(-100, 100, 30),
np.random.randint(-100, 100, 30),
height=10,
inter_points_margin=2,
x_axis_tick_labels=list(range(1, 31)),
y_axis_tick_label_decimal_places=1,
title='Random Values',
horizontal_indentation=6
)
)
Random Values
96.0┤ ╭╮ ╭──╭╮──╮ ╭──╮ ╭╮ ╭╮ ╭╮ ╭───────╮ ╭─╮
74.2┤ ╭╮ ││ │ ││ │ │ ╰╮ ╭╯│ ╭╯│ ╭╯╰╮ ╭╯──╯│ ╰╮╭╯ │
52.4┤ ╭╭╮╮ ╭╯╰╮ ╭╯ ╭╯│ ╰╮ ╭╮ ╭──╮╭╯ │╭╯ ╰╮ ╭─╯ ╰╮╭╮│ │ ╭╯│ │ ╰╯ ╰╮
30.7┤╭╯│╰╮╮╭╯ │ │ │ ╰╮ │ ││ ╭╯ ╰╯ ╰╯ │ │ ││││ ╰╮ ╭╯╭╯ ╰╮ │
8.9┼╯╭╯ │╰╯ │ ╭╯ │ │ │ ╭╮╮ │╭╮ ╰╮ ╭╯ ╭╯╰╮ │ │╭╯ │ │
-12.9┤╭╯ ╰╮ ╰╮│ ╭╯ │ │ ╭─╯╰╮╮╭╭╯│ │╭╯ ╭╯│││ ╭╮╮ ╭╯╯ │ ╰╮
-34.7┤│ │ ╭╮ │ ╰╮ ╰╭╯│ ╰╮╭╯ ╰╮ ╭───╮ ││ ╭╯ ╰╯╰╮ ╭╯│╰──│ ╰╮ ╭──╮ ╭│
-56.4┼╯ ╰─╮ ╭╯╰──╯ │ ╭╯╭╯ ││ ╰╮ ╭╯ ╰─╮╰╯ ╭─╯ ╰─╯ ╰╮ ╭╯ │ ╭╯ ╰─╯╰
-78.2┤ ╰──╯ │╭╯││ ╰╯ │ ╭─╯ ╰╮ ╭─╯ ╰╮│ │╭╯
-100.0┼──┬──┬──┬──┬──┬──┬──├╯─├╯─┬──┬──┬──├─╯┬──┬──┬──├─╯┬──┬──┬──┬──┬──├╯─┬──┬──┬──├╯─┬──┬──┬
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
Acknowledgements
Core sequence asciiization algorithm adopted from https://github.com/kroitor/asciichart/blob/master/asciichartpy/
License
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
asciiplot-0.1.5.tar.gz
(13.3 kB
view details)
Built Distribution
asciiplot-0.1.5-py3-none-any.whl
(15.3 kB
view details)
File details
Details for the file asciiplot-0.1.5.tar.gz
.
File metadata
- Download URL: asciiplot-0.1.5.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.8.13 Linux/5.15.0-43-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16fb493898d546f34a7f279ef089e14b8af9a13c24d7528871c84c74e8299862 |
|
MD5 | a2a92409a33d95983cf2eb5451c1de07 |
|
BLAKE2b-256 | 6b3122024c8f2c8a7413377a468ac2454d887b9ba038b320b4c2619c2f477088 |
File details
Details for the file asciiplot-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: asciiplot-0.1.5-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.8.13 Linux/5.15.0-43-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15a7492ad5633237c35eeb81fb97fb6746f19e76c63de510bb52abd9171b1ec7 |
|
MD5 | cd1e5b147bf955ee5764dd2be4673594 |
|
BLAKE2b-256 | 6a575716fbb4eadb698d49dd44995064392604c22298717823c7c354e44469d7 |