python cmd plot

Solutions on MaxInterview for python cmd plot by the best coders in the world

showing results for - "python cmd plot"
Noemi
02 Jul 2016
1# You can use termplot (terminal plot). Note that termplot requires gnuplot to be set up.
2# install termplot with
3# pip install termplotlib
4# install gnuplot here: http://www.gnuplot.info/
5
6# demo code
7import termplotlib as tpl
8import numpy
9
10x = numpy.linspace(0, 2 * numpy.pi, 10)
11y = numpy.sin(x)
12
13fig = tpl.figure()
14fig.plot(x, y, label="data", width=50, height=15)
15fig.show()
16
17# I discovered termplot through https://stackoverflow.com/questions/37288421/how-to-plot-a-chart-in-the-terminal
18# where Nico Schlömer points out its existence, thank you Nico.