Skip to main content

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 chart
  • examples/ablation.py - Ablation study with gradient colors
  • examples/dual_axis.py - Bandwidth with miss rate overlay
  • examples/kde.py - Distribution visualization

License

Paspale is licensed under the MIT License - see the LICENSE file for details.

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

paspale-0.1.1.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

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

paspale-0.1.1-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file paspale-0.1.1.tar.gz.

File metadata

  • Download URL: paspale-0.1.1.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for paspale-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6295586dbd6d88de4dcff85435b1f84f4675fd74e518ca29b3dd8a7280509856
MD5 08c7bdc695e1b05fc03f19c5c33010d4
BLAKE2b-256 4a0b3df9a837a52086fde3a57df605169f0a23d6fb2575718c2b3c3a12098a78

See more details on using hashes here.

File details

Details for the file paspale-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: paspale-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for paspale-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 422f6c709e0385fa145a6dc7d6340a9c745c5c0da1c45ee0a40bf393e3e7b159
MD5 4b649870f810336ffe54dfe49f3bde65
BLAKE2b-256 12c9ff381e45fe7f1ee90a9c6c2a9bfe3d76ed073ff0dd298c37703bf033adad

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