mirror of
https://github.com/daylinmorgan/viv.git
synced 2024-11-09 19:13:14 -06:00
fix: use plotting example that doesn't require gnuplot
This commit is contained in:
parent
b9b7996b2e
commit
4d314c6286
1 changed files with 8 additions and 7 deletions
|
@ -7,15 +7,16 @@ it will generate a new vivenv.
|
||||||
It may be important to require a exe specificty if you are frequently running
|
It may be important to require a exe specificty if you are frequently running
|
||||||
different version of pythons and rely on c extension modules as in numpy.
|
different version of pythons and rely on c extension modules as in numpy.
|
||||||
"""
|
"""
|
||||||
|
__import__("viv").activate("numpy", "plotext", track_exe=True) # noqa
|
||||||
__import__("viv").activate("numpy", "termplotlib", track_exe=True)
|
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import termplotlib as tpl
|
import plotext as plt
|
||||||
|
|
||||||
x = np.linspace(0, 2 * np.pi, 10)
|
x = np.linspace(0, 2 * np.pi, 100)
|
||||||
y = np.sin(x)
|
y = np.sin(x)
|
||||||
|
|
||||||
fig = tpl.figure()
|
plt.scatter(x, y)
|
||||||
fig.plot(x, y, label="data", width=50, height=15)
|
plt.title("Scatter Plot") # to apply a title
|
||||||
fig.show()
|
plt.plot_size(plt.tw() / 4, plt.th() / 4)
|
||||||
|
plt.theme("pro")
|
||||||
|
plt.show() # to finally plot
|
||||||
|
|
Loading…
Reference in a new issue