Skip to main content

plottoterminal

A plotting utility (library) for plotting data into the terminal encoded as unicode characters as an xy graph, inspired by matplotlib. This tool doesn't have any dependencies on gnuplot or numpy.

Supports:

  • multi scatter plots
  • automatic tick setting for linear scales
  • automatic data rescaling to fit large numbers as tick labels
  • axis labels
  • unit labels
  • command line interface for plotting xy data file ($ plottoterminal file)

Planned:

  • command line interface for xy(z) data plotting
  • bar plot
  • legends
  • z value heatmap
  • color coding support
  • custom marker styles

Example:

import plottoterminal as ptt
import numpy as np

f = ptt.Figure(figsize=(57, 20))
xs = np.linspace(-10, 10, 200)

ys = xs ** 2
f.scatter(xs, ys)

ys2 = -xs ** 2
f.scatter(xs, ys2)

f.set_x_label("x")
f.set_y_label("x*x")
f.set_x_unit("m")
f.set_y_unit("m^2")
f.show()

Output:

   1.0ᐃxx                                         xx     
×10^2 │ xx                                       xx      
[m^2] │  xxx                                   xxx       
      │    xx                                 xx         
   0.5├      xx                             xx           
      │       xxxx                       xxxx            
      │          xxx                   xxx               
x     │             xxxx           xxxx                  
*  0.0├                *************                     
x     │             ****           ****                  
      │          ***                   ***               
      │       ****                       ****            
  -0.5├      **                             **           
      │    **                                 **         
      │  ***                                   ***       
      │ **                                       **      
  -1.0├**                                         **     
      └┴──────────┴──────────┴──────────┴──────────┴────ᐅ
       -1.0       -0.5       0.0        0.5        1.0   
                                x               ×10^1 [m]

Setup

Installing from source:

git clone https://github.com/bitromortac/plottoterminal
cd plottoterminal
python3 -m pip install --user .

Installing from pypi:

python3 -m pip install --user plottoterminal

Command line usage

To plot a file composed of rows of x and y data separated by whitespace, run the command $ plottoterminal file.xy.

Metadata

Release files for plottoterminal 1.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 plottoterminal 1.0
File Size Uploaded
plottoterminal-1.0.tar.gz 9.1 kB Details

Built distribution (wheel)

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

Total release size: 18.6 kB

Release files / plottoterminal-1.0.tar.gz

Download URL plottoterminal-1.0.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a87a2e9e2f94a5452d050b4c0f9e7a0e03271d95a9fc8ab06d7928acb50a8b29
BLAKE2b-256 checksum
How to use checksums
06788e0a0d41de7e5b3f68bc618364313178f7b37e15a17a87d04f87453a4eb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

Release files / plottoterminal-1.0-py3-none-any.whl

Download URL plottoterminal-1.0-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
032210ed380a4407e301f95356ca8b4f84f0c33576ab159127d68a9f5702e428
BLAKE2b-256 checksum
How to use checksums
f281458386b70c3058f462f70a8cf783560fc9427abf1840e013dd3e1e9855c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

Release history Release notifications | RSS feed

This release

1.0 This release

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