Skip to content

Minimal Python package to plot n-D tensors with one call.

License

Notifications You must be signed in to change notification settings

gomezzz/alltheplots

Repository files navigation

alltheplots - Quick & Automatic Plots for All Array Dimensionalities

GitHub GitHub contributors GitHub issues GitHub pull requests CI PyPI - Downloads

Alt Text

Report Bug · Request Feature

Table of Contents
  1. About the Project
  2. Installation
  3. Examples
  4. Dependencies
  5. Contributing
  6. License
  7. Contact

About the Project

alltheplots provides an extremely simple Python interface for creating quick visualizations from numerical arrays, automatically detecting dimensionality (1D, 2D, 3D, 4D, nD) and providing commonly used plots.

The core goal of alltheplots is to abstract away the plotting details, letting you instantly visualize your data without having to remember specific plot types or parameters. It wraps seaborn and matplotlib, providing a user-friendly layer which typically sensible default plots.

  • Simple: Single public .plot() function.
  • Automatic: Detects array dimensionality and chooses appropriate plots automatically.
  • Flexible: Supports numpy-like arrays from libraries such as numpy, pytorch, TensorFlow, jax, and cupy seamlessly.
  • Minimal dependencies: built on top of matplotlib, numpy, scipy, seaborn, scikit-learn, and umap-learn.

Installation

You can install the latest release using pip:

pip install alltheplots

Alternatively, install directly from source (Git required):

git clone https://github.com/gomezzz/alltheplots.git
cd alltheplots
pip install -e .

Examples

Below are a few quick examples demonstrating typical usage.

Basic Usage

Generate standard plots automatically based on the dimensionality of your data.

import numpy as np
from alltheplots import plot

data = np.random.randn(1000)
plot(data)

Saving Plot to File

You can easily save plots to file:

plot(data, filename="my_plot.png", dpi=300)

Custom Theme

Users are encouraged to manage the visual style externally by setting global themes in matplotlib or seaborn. For example:

import seaborn as sns
import matplotlib.pyplot as plt
sns.set_theme(style="ticks", palette="deep")
plt.style.use("dark_background")

# Then call the plot function
plot(data)

This approach provides more flexibility and aligns with best practices for managing plot aesthetics.

Example Notebooks

For more detailed examples, check out the notebooks in the examples/ directory:

  • 1D Examples - Visualizing 1D arrays with time-domain, frequency-domain, and distribution plots
  • 2D Examples - Visualizing 2D arrays with heatmaps, contours, and 3D surface plots
  • 3D Examples - Visualizing 3D arrays with slice views, projections, and distribution analysis
  • nD Examples - Visualizing high-dimensional arrays with dimensionality reduction techniques

These notebooks provide comprehensive examples of the various visualization capabilities and can help you understand how to best use the library for your specific data.

Dependencies

  • matplotlib - Core plotting library
  • numpy - Array manipulation
  • scipy - Scientific computing
  • seaborn - Statistical data visualization
  • scikit-learn - Machine learning for dimensionality reduction
  • umap-learn - UMAP dimensionality reduction for high-dimensional data
  • loguru - Logging

Contributing

Contributions are welcome! Please open issues and submit PRs at the GitHub repository.

License

Distributed under the GPL 3 License. See LICENSE for more information.

About

Minimal Python package to plot n-D tensors with one call.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages