You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A powerful Python plotting library that leverages OpenGL to provide exceptional performance and high-quality visualizations of 2D data. Based on the JavaScript library webgl-plot this library is specifically designed for real-time plotting of line, scatter, and histogram plots. This library is cross-platform and works on Windows, Linux and Mac thanks to GLFW windowing library. Furthermore, It is also compatible with Jupyter notebooks. This package is ideal for plotting realtime data from sensors and instruments, including streaming devices such as microphones and cameras, empowering users to analyze data as it is being generated.
Installation
python -m pip install pyglplot
Getting started
importnumpyasnpfrompyglplotimportline# Create a Line objectLINE_SIZE=2000LINE_NUMBER=1plot_line=line.Line(LINE_SIZE, LINE_NUMBER)
x=np.linspace(-1, 1, LINE_SIZE)
y=np.sin(np.pi*x)
# Add data to the lineplot_line.update_color(0, [255, 0, 255])
plot_line.update_line_xy(0, x, y)
plot_line.run()
Animating a plot
importnumpyasnpfrompyglplotimportline# Create a Line objectLINE_SIZE=2000LINE_NUMBER=1plot_line=line.Line(LINE_SIZE, LINE_NUMBER)
x=np.linspace(-1, 1, LINE_SIZE)
y=np.sin(np.pi*x)
# Add data to the lineplot_line.update_color(0, [255, 0, 255])
plot_line.update_line_xy(0, x, y)
defupdate():
y=0.5*np.sin(np.pi*x) +np.random.rand(LINE_SIZE) *0.1plot_line.update_line_y(0, y)
plot_line.run(update)
License
MIT
About
A high-performance OpenGL line plotting library for Python