tplot
is a Python package for creating text-based graphs. Useful for visualizing data to the terminal or log files.
tplot
is available on PyPi:
pip install tplot
Documentation is available on readthedocs.
import tplot
fig = tplot.Figure()
fig.scatter([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
fig.show()
import tplot
import numpy as np
x = np.linspace(start=0, stop=np.pi*3, num=80)
fig = tplot.Figure(
xlabel="Phase",
ylabel="Amplitude",
title="Trigonometric functions",
legendloc="bottomleft",
width=60,
height=15,
)
fig.line(x, y=np.sin(x), color="red", label="sin(x)")
fig.line(x, y=np.cos(x), color="blue", label="cos(x)")
fig.show()
See more examples in the documentation.
Contributions are welcome. Bug fixes, feature suggestions, documentation improvements etc. can be contributed via issues and/or pull requests.