A unified plotting framework for academic papers
Project description
PasPale
PasPale provides a consistent, configurable interface for creating publication-ready figures with minimal boilerplate code.
Features
- 🎨 Unified Style - Consistent colors, fonts, and layouts across all plots
- ⚙️ Configurable - Dataclass-based configuration with sensible defaults
- 📊 Multiple Plot Types - Bar charts, stacked bars, dual-axis, KDE, and more
- 📄 Publication Ready - PDF output with proper fonts and sizing
- 🔧 Extensible - Easy to create custom plotters by inheritance
Installation
pip install paspale
Or install from source:
git clone https://github.com/undefined-c0der/paspale.git
cd paspale
pip install -e .
Quick Start
1. Simple Bar Chart
from paspale import paspale
paspale(
data="data/results.csv",
output="figures/comparison.pdf",
ylabel="Speedup",
legend=["Method A", "Method B", "Method C"],
)
2. Using Configuration
from paspale import BarPlotter, PlotConfig
config = PlotConfig(
output="figures/performance.pdf",
ylabel="Speedup",
ylim=6.0,
legend=["Baseline", "Optimized", "Ours"],
colors="primary",
)
plotter = BarPlotter(config)
plotter.load_csv("data/results.csv")
plotter.plot()
3. KDE Distribution Plot
from paspale import KDEPlotter, KDEConfig
config = KDEConfig(
output="figures/distribution.pdf",
xlabel="Value",
ylabel="Density",
)
# From CSV (each column is a distribution)
plotter = KDEPlotter(config)
plotter.load_csv("data/distributions.csv")
plotter.plot()
# Or from arrays
import numpy as np
plotter = KDEPlotter(config)
plotter.load_data([arr1, arr2], labels=["A", "B"])
plotter.plot()
4. Custom Plotter
from paspale import BarPlotter, PlotConfig
class MyPlotter(BarPlotter):
def configure(self) -> PlotConfig:
return PlotConfig(
output="figures/my_plot.pdf",
ylabel="Performance",
ylim=10.0,
legend=["A", "B", "C"],
)
def customize(self):
self.ax.axhline(y=1.0, color='red', linestyle='--')
plotter = MyPlotter()
plotter.load_csv("data/my_data.csv")
plotter.plot()
Unified Interface
All plotters follow the same pattern:
plotter = SomePlotter(config)
plotter.load_csv("data.csv") # or load_data(df)
plotter.plot()
| Plotter | Config | Description |
|---|---|---|
BarPlotter |
PlotConfig |
Grouped bar charts |
StackedBarPlotter |
PlotConfig |
Stacked bar charts |
DualAxisPlotter |
PlotConfig |
Dual Y-axis plots |
LinePlotter |
PlotConfig |
Line charts |
KDEPlotter |
KDEConfig |
Kernel density estimation |
Configuration
PlotConfig Options
| Option | Type | Default | Description |
|---|---|---|---|
output |
str | Required | Output file path |
size |
tuple | (14, 4.5) | Figure size (width, height) |
ylabel |
str | "" | Y-axis label |
xlabel |
str | "" | X-axis label |
ylim |
float | None | Y-axis upper limit |
ylim_min |
float | 0.0 | Y-axis lower limit |
legend |
list | [] | Legend labels |
colors |
str/list | "primary" | Color scheme or list |
log_scale |
bool | False | Use log scale for Y-axis |
KDEConfig Options
| Option | Type | Default | Description |
|---|---|---|---|
output |
str | "" | Output file path |
size |
tuple | (8, 5) | Figure size |
xlabel |
str | "" | X-axis label |
ylabel |
str | "Density" | Y-axis label |
xlim |
tuple | None | X-axis limits |
fill |
bool | True | Fill under curve |
alpha |
float | 0.3 | Fill transparency |
use_percentage |
bool | False | Show Y as percentage |
Color Schemes
from paspale import colors
colors.PRIMARY # 6 pastel colors
colors.EXTENDED # 11 colors
colors.GRADIENT # Blue gradient for ablations
colors.BREAKDOWN # Component colors
colors.LINES # Line plot colors
Examples
See examples/ directory:
examples/bar.py- Basic bar chartexamples/ablation.py- Ablation study with gradient colorsexamples/dual_axis.py- Bandwidth with miss rate overlayexamples/kde.py- Distribution visualization
License
Paspale is licensed under the MIT License - see the LICENSE file for details.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file paspale-0.1.2.tar.gz.
File metadata
- Download URL: paspale-0.1.2.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e003dd2a123151606ea2ba85e01ef5ea2cbe1f6ee7b6d2bd037b2d3460aa22cc
|
|
| MD5 |
a4a7adc9e636ca038d110f02e49e1c12
|
|
| BLAKE2b-256 |
3c947bb06d19f48f78384cc19fce432bae71cd825d4f9ee15c70185fd7cc1505
|
File details
Details for the file paspale-0.1.2-py3-none-any.whl.
File metadata
- Download URL: paspale-0.1.2-py3-none-any.whl
- Upload date:
- Size: 20.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23f4a2310a500f286c5a5265f15c21705aef5200c1c08fedfce79c53548fd582
|
|
| MD5 |
e9d405f0d87435ee8cf0324e6f777646
|
|
| BLAKE2b-256 |
136e7bf564520db6b6db4f90659203e2d08613dd274ec9de0383ee9565889d71
|