Render matplotlib plots in terminal.
Project description
matplotlib-terminal
Matplotlib backend to plot in terminal using matrach/img2unicode
This is in proof of concept stage, so stay tuned!
The library is optimized for Gnome Terminal with Ubuntu Mono font.
Nevertheless 'block' and 'braille' renderers should work with most modern terminals.
Install it with:
$ pip install matplotlib-terminal
To speed ~10x up the braille and gamma renderers, install an optional dependency of img2unicode:
$ pip install 'img2unicode[n2]'
Usage:
import matplotlib_terminal
import matplotlib.pyplot as plt
# Or in short:
# from matplotlib_terminal import plt
plt.plot([0, 1], [0, 1])
plt.plot([1, 0], [0, 1], lw=3)
plt.scatter([0], [.5])
plt.show()
plt.show('gamma') # Use RendererGamma-fast/noblock from img2unicode renderer
plt.show('block') # Use Renderer-fast/block from img2unicode, dual color!
plt.show('braille') # Use RendererGamma-fast/braille from img2unicode renderer
plt.close()
Sample results
Gamma renderer:
Block renderer:
Braille renderer:
TODO
- figure out how to configure the lib in matplotlib-ish way (eg. rcParams)
- allow to specify figure size in terms of cells
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file matplotlib-terminal-0.1a4.tar.gz.
File metadata
- Download URL: matplotlib-terminal-0.1a4.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1876ed41221d2a49c6b0a002eb6b2b3417a73bb16c687baab8094140cc4bd458
|
|
| MD5 |
d48f6f9a3746d4c6e61534177ecb5471
|
|
| BLAKE2b-256 |
19f8b42ad115aa0ce52da3f98946f3dbbce5d02e24b19b03932e10375e55a909
|
File details
Details for the file matplotlib_terminal-0.1a4-py3-none-any.whl.
File metadata
- Download URL: matplotlib_terminal-0.1a4-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc762b1a4adf86bfbeac3423390a8bdb934368078a6ac85bea1b54ed58a709a7
|
|
| MD5 |
0043fdd1221daf254140836bdbf5fed5
|
|
| BLAKE2b-256 |
cd87178688c9d3d8aa6e22b3e7c9a965a06c27413e9a1b6738a52a9fccea7c09
|