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.1.tar.gz (69.8 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.1-py3-none-any.whl (70.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: glplot-0.1.1.tar.gz
  • Upload date:
  • Size: 69.8 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.1.tar.gz
Algorithm Hash digest
SHA256 90bc94869401bb0567a925d49600f1093b8e4408635f4ac32407e2480455193a
MD5 a9036e839bea1614b295cac89cb52d6a
BLAKE2b-256 641ffc3372dd55af2abd6e37c4a45d6667d6893cd752d4d115dc99ccd7169c54

See more details on using hashes here.

File details

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

File metadata

  • Download URL: glplot-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 70.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7076136f119a402a203ee2fb317d02c103ac6788946c1ced63aec287dc08f37c
MD5 8d9dda295b0c1164e766c89324a3b21c
BLAKE2b-256 d6eb8146b5b82af38f166363d32637bd22eb433d147cb49611d980a59a50afc6

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