An object oriented wrapper combining the functionalities of Matplotlib and Scipy
Project description
GraphingLib
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:
- 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.
- Data Analysis Functions: Implement common data analysis functions and operations to streamline the visualization process.
- 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.
- MultiFigures: Combine different Figure objects into one MultiFigure with one line of code.
- Polygon Manipulation: Obtain useful information such as area, centroid, and perimeter of polygons, and manipulate them using transform and set operations methods.
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
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, number_of_bins=15)
residuals.add_pdf("normal")
# Create and show figures
fig1 = gl.Figure(
x_label="Time [s]",
y_label="Position [mm]",
title="Position as a function of time",
)
fig1.add_elements(scatter, fit)
fig2 = gl.Figure(
y_lim=(0, 0.06),
x_label="Distance from fit [mm]",
y_label="Frequency [-]",
title="Histogram of fit residuals",
)
fig2.add_elements(residuals)
multifigure = gl.MultiFigure.from_row([fig1, fig2], size=(10, 5))
multifigure.show()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file graphinglib-1.5.0.tar.gz
.
File metadata
- Download URL: graphinglib-1.5.0.tar.gz
- Upload date:
- Size: 56.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c067409c044cf3b884c10d16f1a2c9242caa2bd900c474f859d59cc058bc51e9 |
|
MD5 | bb40e362e1da6ff183397b60cab0b1ee |
|
BLAKE2b-256 | 2dc1ed3cd96fd99260d2c209c50f65bc98656a38d47a619391837aa5ad42874d |
File details
Details for the file graphinglib-1.5.0-py3-none-any.whl
.
File metadata
- Download URL: graphinglib-1.5.0-py3-none-any.whl
- Upload date:
- Size: 63.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | da13b59d101a4cc72e80bfec3cc255281a050fb011a6441711857cd4d8ca17fc |
|
MD5 | 1392390158fba40642b10ffccba0f7bd |
|
BLAKE2b-256 | 5af7a0770eee832b5341bfae1b2c984fa650420166ecb6cca797fa472ea165b3 |