Skip to main content

High-performance OpenGL plotting library, similar to Matplotlib

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.0.tar.gz (74.3 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.0-py3-none-any.whl (69.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: glplot-0.1.0.tar.gz
  • Upload date:
  • Size: 74.3 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.0.tar.gz
Algorithm Hash digest
SHA256 55e4119b70bc2d2371a1e69c7f98ee0772377fda3ed597dbcbf20a6ba24f8b4a
MD5 50ea5d54d1056ac7113eab87ae2b585f
BLAKE2b-256 9aeb7a2a51e4ac95babc2b9dcd26e287403fd79862e8211f278ef1137d7517cf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: glplot-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 69.0 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86cbe600ab99519827937f5eeba0fdf9fd2fae7812a290d74497c8fc7bc0cdc0
MD5 5ea3cd9ecb51d08d72469fef3050abdc
BLAKE2b-256 49444b06dc8cd4f9c7872a24647021c1ad0c0cf08f639af7ba6b634f55751070

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