Python termplotlib

From wikinotes
Revision as of 23:48, 28 August 2020 by Will (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A very useful python library that aims to reproduce matplotlib using ascii
so that it can be used on headless servers.

Unfortunately, it seems you cannot render multiple lines on one graph.

import termplotlib

fig = termplotlib.figure()
fig.plot([0, 1, 2], [1, 2, 3])   # line/chart-1
fig.plot([0, 1, 2], [1, 5, 10])  # line/chart-2
fig.show()  # prints to stdout