Skip to main content

asciiplot

PyPI - Python Version Build codecov PyPI GitHub release (latest SemVer) Downloads GitHub

Platform-agnostic, highly customizable sequence plotting in the console alt text

Installation

pip install asciiplot

Plot Appearance Configuration Options

You may set the/a

  • chart height & title
  • color of virtually all chart components and areas, picked from a wide array of shades due to the integration of colored
  • margin between consecutive data points to widen your chart
    • tick point color, to make the tick points visually stand out in case of a margin having been set
  • chart indentation within its hosting terminal, or whether it ought to be centered in it, respectively
  • axes descriptions
  • x-axis tick labels, which may be set to contain strings instead of just numeric values
  • y-axis tick label decimal places

Usage Examples

from asciiplot import asciiize, Color


print(
    asciiize(
        [0, 1, 1, 2, 3, 5, 8, 13, 21],
        sequence_colors=[Color.BLUE_3B],
        height=22,
        inter_points_margin=5,
        background_color=Color.LIGHT_SALMON_1,
        tick_point_color=Color.RED_1,
        label_color=Color.BLUE_VIOLET,
        label_background_color=Color.DEEP_PINK_3A,
        title='Fibonacci',
        title_color=Color.RED_1,
        x_axis_description='x',
        y_axis_description='y',
        center_horizontally=True
    )
)

alt text

from asciiplot import asciiize, Color


print(
    asciiize(
        [17, 21, 19, 19, 5, 7, 12, 4],
        [7, 8, 3, 17, 19, 18, 5, 2, 20],
        sequence_colors=[Color.RED, Color.BLUE_VIOLET],
        inter_points_margin=5,
        height=20,
        background_color=Color.GREY_7,
        title='Random Sequences',
        title_color=Color.MEDIUM_PURPLE,
        label_color=Color.MEDIUM_PURPLE,
        x_axis_description='x',
        y_axis_description='y',
        center_horizontally=True
    )
)

alt text

Credits

The core sequence asciiization algorithm was adopted from asciichartpy.

Run Tests

git clone https://github.com/w2sv/asciiplot.git
cd asciiplot
poetry install
make test  # runs mypy, pytest doctest and outputs test coverage

License

MIT

Metadata

Release files for asciiplot 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asciiplot 1.0.0
File Size Uploaded
asciiplot-1.0.0.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for asciiplot 1.0.0
File Interpreter ABI Platform
asciiplot-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.9 kB

Release files / asciiplot-1.0.0.tar.gz

Download URL asciiplot-1.0.0.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a7d4c50df2aa3218d0426160a46ed421899f2ac1d9d5bf26ec3836cd9a89ed40
BLAKE2b-256 checksum
How to use checksums
e1f7776190348f5d687ca5dc6eb231c9ee9d9a5d2eeeb96e788388e69e18b2c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.10.6 Linux/5.19.0-31-generic

Release files / asciiplot-1.0.0-py3-none-any.whl

Download URL asciiplot-1.0.0-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c407afe8622b8207e84cd613d1b80ddc457291d84d89ad6352ffe17353b25c47
BLAKE2b-256 checksum
How to use checksums
766daee11414a7f8cdf6f741657ad140a37eca1a689555250dd19b356139f976
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.10.6 Linux/5.19.0-31-generic

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

1 release file

0.0.8

2 release files

0.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page