High-performance, GPU-accelerated plotting library in Python, designed to handle millions of lines effortlessly. It provides an API similar to Matplotlib but runs natively over an OpenGL/GLFW backend, performing instanced rendering directly on the GPU.
-
Matplotlib API Compatibility: Familiar
plot(x, y),show(),savefig(). -
Phase Diagram Optimized (
plot_lines): Explicitly supports passing millions of line parameters$(a, b)$ to calculate functions$y = ax + b$ securely bounded to bounds using shader math. -
Logarithmic Density Heaps: By displaying overlaps,
density=Truehandles millions of parallel curves seamlessly for heatmaps. - Dynamic Camera: Drag to pan, scroll to zoom with on-the-fly resolution subsampling.
You can install this locally:
pip install .Requirements: numpy, glfw, PyOpenGL, scipy, matplotlib.
Traditional Polylines
import numpy as np
import glplot.pyplot as gplt
x = np.linspace(0, 10, 100)
y = np.sin(x)
gplt.figure("Sine Wave")
gplt.plot(x, y, color=(1.0, 0.0, 0.0, 1.0))
gplt.show()Bulk Lines (Density Map)
import numpy as np
import glplot.pyplot as gplt
N = 1000000
a = np.random.randn(N)
b = np.random.randn(N)
gplt.figure("Density")
gplt.plot_lines(a, b, x_range=(-2, 2))
gplt.show(density=True)Uses pytest covering 100% of the internal application logic without popping visible windows:
pytest