Platform-agnostic, customizable sequence plotting in console, offering high suitability for GUIs
Project description
asciiplot
Platform-agnostic sequence plotting in console, offering various chart appearance configuration options and thus giving rise to an increased degree of GUI suitability
Install
$ pip install asciiplot
Plot configuration options
- Setting of consistent margin between data points
- Determination of chart height
- Setting of chart title
- Axes descriptions display
- Setting of x-axis tick labels, possibly being of both numeric and string type
- Determination of y-axis tick label decimal points
- Centering the chart within the target terminal or indenting it by a passed number of columns respectively
- Setting color of all chart components due to integration of colored
Examples
from asciiplot import asciiize
print(
asciiize(
[1, 1, 2, 3, 5, 8, 13, 21],
height=15,
inter_points_margin=7,
x_ticks=list(range(1, 9)),
y_ticks_decimal_places=0,
x_axis_description='Iteration',
y_axis_description='Value',
title='Fibonacci Sequence',
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_ticks=list(range(1, 31)),
y_ticks_decimal_places=1,
title='Random Values',
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
References
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.0.8.tar.gz
(13.4 kB
view details)
Built Distribution
asciiplot-0.0.8-py3-none-any.whl
(15.0 kB
view details)
File details
Details for the file asciiplot-0.0.8.tar.gz
.
File metadata
- Download URL: asciiplot-0.0.8.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.7.4 Linux/5.4.0-109-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c90b16446c1b047790b59e6521d09b92db1a7ab78f233e56838a559cb232d0e0 |
|
MD5 | 939c8f6789dc39d62e7dcb8f15e96c4a |
|
BLAKE2b-256 | 8460bd014dba96299851a9511f9a72f21ce309a205c34863d3bfef64939bbd0f |
File details
Details for the file asciiplot-0.0.8-py3-none-any.whl
.
File metadata
- Download URL: asciiplot-0.0.8-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.7.4 Linux/5.4.0-109-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fd4f39e1b17c3bb8f9cebb5b3e9f14a804f7bc0f35e97b8da70fef9db3f0e73 |
|
MD5 | 5ad291431697ab0ace4e5b61df3d2c3c |
|
BLAKE2b-256 | 982f2a89a5abbed251a1eeebe6c79457b0a523ef3c2ecba447ed6566217d87f5 |