Skip to main content

High-performance OpenGL plotting library for Python

Project description

GLPlot

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.

Features

  • 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=True handles millions of parallel curves seamlessly for heatmaps.
  • Dynamic Camera: Drag to pan, scroll to zoom with on-the-fly resolution subsampling.

Installation

You can install this locally:

pip install .

Requirements: numpy, glfw, PyOpenGL, scipy, matplotlib.

Usage

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)

Testing

Uses pytest covering 100% of the internal application logic without popping visible windows:

pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

glplot-0.1.2.tar.gz (75.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

glplot-0.1.2-py3-none-any.whl (75.8 kB view details)

Uploaded Python 3

File details

Details for the file glplot-0.1.2.tar.gz.

File metadata

  • Download URL: glplot-0.1.2.tar.gz
  • Upload date:
  • Size: 75.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for glplot-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d1761117f14ae2570e7ee2f8890a4684c2ab02af201306db30f2005906d43322
MD5 c2c6e8663d0493c2dff4c468c3864d3d
BLAKE2b-256 151e99af0814a06e8f24536fba74f12c30dfb5fddc5f39a140bd67cd2416ee72

See more details on using hashes here.

File details

Details for the file glplot-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: glplot-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 75.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for glplot-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4664cf87be5938786624e02d379c450913be1469cc1c3b59a3896b058c0f8134
MD5 8e0c823d5d2b59fd1e33568f08025da0
BLAKE2b-256 0a206ead1eb71f6390e35aa0006826f5b7eef9fa1d408edccda8beb5bdff4b27

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page