All Projects → daleroberts → Itermplot

daleroberts / Itermplot

An awesome iTerm2 backend for Matplotlib, so you can plot directly in your terminal.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Itermplot

sarviewer
Generate graphs with gnuplot or matplotlib (Python) from sar data
Stars: ✭ 60 (-95.26%)
Mutual labels:  plot, matplotlib
matplotlib-haskell
Haskell bindings for Python's Matplotlib
Stars: ✭ 80 (-93.69%)
Mutual labels:  plot, matplotlib
heatmaps
Better heatmaps in Python
Stars: ✭ 117 (-90.77%)
Mutual labels:  plot, matplotlib
Asciigraph
Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.
Stars: ✭ 1,805 (+42.46%)
Mutual labels:  command-line, plot
Termplotlib
Plotting on the command line
Stars: ✭ 294 (-76.8%)
Mutual labels:  command-line, plot
publib
Produce publication-level quality images on top of Matplotlib
Stars: ✭ 34 (-97.32%)
Mutual labels:  plot, matplotlib
reddit-hot-recorder
Records the activity (comments and karma) on the hot page of a Reddit sub and prepare an animated data visualisation.
Stars: ✭ 89 (-92.98%)
Mutual labels:  plot, matplotlib
Bv
Quickly view satellite imagery, hyperspectral imagery, and machine learning image outputs directly in your iTerm2 terminal.
Stars: ✭ 215 (-83.03%)
Mutual labels:  command-line, iterm2
Tensorflow Plot
📈 TensorFlow + Matplotlib as TF ops
Stars: ✭ 285 (-77.51%)
Mutual labels:  matplotlib, plot
nodeplotlib
NodeJS plotting library for JavaScript and TypeScript. On top of plotly.js. Inspired by matplotlib.
Stars: ✭ 115 (-90.92%)
Mutual labels:  plot, matplotlib
Matplotlib4j
Matplotlib for java: A simple graph plot library for java with powerful python matplotlib
Stars: ✭ 107 (-91.55%)
Mutual labels:  matplotlib, plot
Adjusttext
A small library for automatically adjustment of text position in matplotlib plots to minimize overlaps.
Stars: ✭ 731 (-42.3%)
Mutual labels:  matplotlib, plot
mltb
Machine Learning Tool Box
Stars: ✭ 25 (-98.03%)
Mutual labels:  plot, matplotlib
bitrate-plotter
Plots a graph showing the bitrate every second or the bitrate of every GOP, for a video or audio file.
Stars: ✭ 15 (-98.82%)
Mutual labels:  plot, matplotlib
Vapeplot
matplotlib extension for vaporwave aesthetics
Stars: ✭ 483 (-61.88%)
Mutual labels:  matplotlib, plot
Rustplotlib
A Rust's binding of matplotlib
Stars: ✭ 31 (-97.55%)
Mutual labels:  matplotlib, plot
Alfred Cheat
Manage your self-defined cheat sheets & knowledge base in Alfred
Stars: ✭ 79 (-93.76%)
Mutual labels:  command-line
Sampler
Tool for shell commands execution, visualization and alerting. Configured with a simple YAML file.
Stars: ✭ 9,203 (+626.36%)
Mutual labels:  command-line
Tsv Utils
eBay's TSV Utilities: Command line tools for large, tabular data files. Filtering, statistics, sampling, joins and more.
Stars: ✭ 1,215 (-4.1%)
Mutual labels:  command-line
Unix Text Commands
Unix Text Processing Command Reference
Stars: ✭ 78 (-93.84%)
Mutual labels:  command-line

itermplot

An awesome iTerm2 backend for Matplotlib, so you can plot directly in your terminal.

The above is achieved with zero modifications to your Python script. For example, the above plots are generated with the following code:

import numpy as np
import matplotlib.pyplot as plt
import networkx as nx

plt.rcParams["font.size"] = 10

plt.figure(figsize=(8,3))

ax = plt.subplot(121)
x = np.arange(0,10,0.001)
ax.plot(x, np.sin(np.sinc(x)), 'r', lw=2)
ax.set_title('Nice wiggle')

ax = plt.subplot(122)
plt.tick_params(axis='both', left='off', top='off', right='off', bottom='off', labelleft='off', labeltop='off', labelright='off', labelbottom='off')
G = nx.random_geometric_graph(200, 0.125)
pos=nx.spring_layout(G)
nx.draw_networkx_edges(G, pos, alpha=0.2)
nx.draw_networkx_nodes(G, pos, node_color='r', node_size=12)
ax.set_title('Random graph')

plt.show()

Note: you need to run plt.show() to display the figure.

Reverse video

If you use a dark background in your terminal, you can enable "reverse video" mode by adding this to your .profile:

export ITERMPLOT=rv

TMUX support

itermplot tries to auto-detect TMUX and behave in a sane way. Vertical split panes do not work well due to a limitation with iTerm2. Luckily, horizontals do though.

Animation support

itermplot supports animation created by matplotlib animation module.

You'll need to install ImageMagick and have it on the path to use the animation support. The simpliest way to see if ImageMagick is installed and valid is to run:

$ convert -version
Version: ImageMagick 7.0.4-4 Q16 x86_64 2017-01-14 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib

To enable animation support, you need to specifying the desired number of frames in the output animation. For example, specify it before your script with:

$ ITERMPLOT_FRAMES=30 python script.py

You can also save the resulting gif file by using ITERMPLOT_OUTFILE environment variable:

$ ITERMPLOT_FRAMES=30 ITERMPLOT_OUTFILE=out.gif python script.py

Currently animation does not support reverse video with ITERMPLOT=rv.

Configure lines

You can configure the number of lines used with the ITERMPLOT_LINES environment variable. For example:

ITERMPLOT_LINES=5 python3 simple.py

Python 2 and Python 3 support

Now supports Python 2, even if this makes me want to cry 😭

Installation

Using pip

Install using pip using the command:

pip3 install itermplot

itermplot is enabled by setting MPLBACKEND in your environment. If you use bash, then this can be accomplished using the command:

export MPLBACKEND="module://itermplot"

Note: you can add the export line above to your .profile file so that itermplot is always enabled in your terminal.

Testing

To test your installation you can do the following in your iTerm2 console:

$ echo $MPLBACKEND
module://itermplot
$ python3
Python 3.5.2 (default, Oct 24 2016, 09:14:06)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.pyplot as plt
>>> plt.plot([1,2,3])
[<matplotlib.lines.Line2D object at 0x1041f2e48>]
>>> plt.show()

You should see a plot!

Uninstall

You can disable this backend by unsetting the MPLBACKEND environment variable.

$ unset MPLBACKEND
$ echo $MPLBACKEND

$ python3
Python 3.5.2 (default, Oct 24 2016, 09:14:06)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.pyplot as plt
>>> plt.plot([1,2,3])
[<matplotlib.lines.Line2D object at 0x1106bdcc0>]
>>> plt.show()

To remove the package completely, run:

pip3 uninstall itermplot

Bugs

This backend is very alpha, so if you have a problem please raise an Issue on GitHub and I will try to fix it.

I also accept (and appreciate!) good patches / pull request. Thanks to garrywu, brenshanny, hbredin, zevlg for their patches so far.

Other cool things

I encourage you to check-out some of my other little projects. Lots more coming as I slowly release them...

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].