Check the package plotext,
which allows to plot data directly on terminal using python3.
It is very intuitive,
as its use is very similar to the matplotlib package.
sudo -H pip install plotext
As for matplotlib, the main functions are scatter
(for single points), plot
(for points joined by lines) and show
(to actually print the plot on terminal). It is easy to specify the plot dimensions, the point and line styles and whatever to show the axes, number ticks and final equations, which are used to convert the plotted coordinates to the original real values.
Here is an example plot:
![](https://cdn.statically.io/img/i.sstatic.net/rQie4.png)
Here is the code to produce the plot shown above:
import plotext.plot as plx
import numpy as np
l=3000
x=np.arange(0, l)
y=np.sin(4*np.pi/l*np.array(x))*np.exp(-0.5*np.pi/l*x)
plx.scatter(x, y, rows = 17, cols = 70)
plx.show(clear = 0)
The option clear=True
inside show
is used to clear the terminal before plotting;
this is useful, for example, when plotting a continuous flow of data.
The package description provides more information how to customize the plot.
The package has been tested on Ubuntu 16 where it works perfectly. Possible future developments (upon request) could involve extension to python2 and to other graphical interfaces (e.g., jupiter). Please let me know if you have any issues using it.