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.1.4.tar.gz
(13.4 kB
view details)
Built Distribution
asciiplot-0.1.4-py3-none-any.whl
(15.0 kB
view details)
File details
Details for the file asciiplot-0.1.4.tar.gz
.
File metadata
- Download URL: asciiplot-0.1.4.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 | de25bf04e3ab3bbf9f9e894e4a932724e00aa54818e13f6c04bd69a844547ab9 |
|
MD5 | da8cb97d69aa4d92ff08e216100cbd81 |
|
BLAKE2b-256 | d6bd21a9ded26eb0b094a2dbb132b1573fd86ccda66dec306826382a28113df8 |
File details
Details for the file asciiplot-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: asciiplot-0.1.4-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 | a45d59ae9945f520f0a7638295a4b2860294afaa48dc7f534b657b19675c13e3 |
|
MD5 | f1a0378dd01fa40592c4d75c46b36f63 |
|
BLAKE2b-256 | 769471d29b9d7293f192e864ff6f39fe22bb12b38f459ae79e397e2dbbd4f0db |