Skip to main content

An object oriented wrapper combining the functionalities of Matplotlib and Scipy

Project description

PyPI version Documentation Status License PyPi downloads GitHub stars

GraphingLib

graphinglib logo

GraphingLib is an open-source data visualization library in Python, designed as a wrapper for matplotlib. It integrates powerful data manipulation features from libraries such as scipy, shapely, and others.

GraphingLib has the following explicit goals:

  1. Simplify Plotting: Provide the simplest, most intuitive, and user-friendly API to enable users to create plots in as few lines of code as possible.
  2. Data Analysis Functions: Implement common data analysis functions and operations to streamline the visualization process.
  3. Custom Figure Styles: Facilitate the customization and reuse of figure styles.

How is GraphingLib different?

  • Object-Oriented Plotting: Figures and plotted elements are all objects, making it easier to manage and manipulate plots and elements.
  • Curve Fitting: Perform curve fitting with a single line of code.
  • Curve Operations: Carry out differentiation, integration, arithmetic, intersections, and other standard operations on Curve objects.
  • GUI Style Editor: Use the GraphingLib Style Editor to create and modify custom styles, and set them as your default style.
  • Polygon Manipulation: Obtain useful information such as area, centroid, and perimeter of polygons, and manipulate them using transform and set operations methods.
  • SmartFigures: Create modular figures with multiple sub-figures and an intuitive syntax.

Getting started

To get started with GraphingLib, check out our comprehensive documentation and examples available on our website. Whether you're a beginner or an experienced user, our documentation provides step-by-step guides to help you make the most out of GraphingLib. Here are a few ways to install GraphingLib:

From PyPI with

pip install graphinglib

From source with

pip install git+https://github.com/GraphingLib/GraphingLib.git

Using Poetry with

poetry add graphinglib

Using uv with

uv add graphinglib

Optional extras:

  • Astronomical projections (SmartFigureWCS): install pip install graphinglib[astro]

Contributing

We welcome contributions from the community. If you're interested in contributing to GraphingLib, please read our contribution guidelines on our documentation website.

Example

Here is a short example showing how to use GraphingLib to create a figure with a scatter plot, a fit, and a histogram of the residuals.

import graphinglib as gl
import numpy as np

# Data creation
np.random.seed(2)
x_data = np.linspace(0, 10, 100)
y_data = 3 * x_data**2 - 2 * x_data + np.random.normal(0, 10, 100)

# Create elements
scatter = gl.Scatter(x_data, y_data, label="Position data")
fit = gl.FitFromPolynomial(scatter, degree=2, label="Fit", color="red")
residuals = gl.Histogram.from_fit_residuals(fit, bins=15)
residuals.add_pdf("normal")

# Create and show figure
fig = gl.SmartFigure(
    num_cols=2,
    num_rows=1,
    size=(10, 5),
    y_lim=[None, (0, 0.06)],
    sub_x_labels=["Time [s]", "Distance from fit [mm]"],
    sub_y_labels=["Position [mm]", "Frequency [-]"],
    subtitles=["Position as a function of time", "Histogram of fit residuals"],
)
fig[0] = [scatter, fit]
fig[1] = [residuals]
fig.show()

image

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

graphinglib-1.6.0.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

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

graphinglib-1.6.0-py3-none-any.whl (124.8 kB view details)

Uploaded Python 3

File details

Details for the file graphinglib-1.6.0.tar.gz.

File metadata

  • Download URL: graphinglib-1.6.0.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for graphinglib-1.6.0.tar.gz
Algorithm Hash digest
SHA256 e1897a636f60c8019d175c6dd7f925f15bf5fd837f6f2de2100387f7309bb081
MD5 1a03fa0c3e834e725574ebb227cc48f1
BLAKE2b-256 500cdfb0d3c73e0e6cb2eab9e8096962bbccf099000cf4e7a64c51de322e3b1e

See more details on using hashes here.

File details

Details for the file graphinglib-1.6.0-py3-none-any.whl.

File metadata

  • Download URL: graphinglib-1.6.0-py3-none-any.whl
  • Upload date:
  • Size: 124.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for graphinglib-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 07e51268bee4eb5296fa008dd96f4006e3927b23759954d0ea4a0dd83b23978d
MD5 42997166610aaeab856b22046d7d7369
BLAKE2b-256 32d978691395bbbf531fb0534f3c5ec9fc2f0dd2850a4f7597d2f6f6c65fd593

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