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

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.0.tar.gz (17.7 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.0-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: paspale-0.1.0.tar.gz
  • Upload date:
  • Size: 17.7 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.0.tar.gz
Algorithm Hash digest
SHA256 083c204b441afcd9768f7054fc57527287228aa3a24007de7bfa6ee26f2f61eb
MD5 370e8d1bbafabc7c4cca669a34b0a355
BLAKE2b-256 7cc45633dfdd61d1bb820b52cd0ecc440e2e310197a218d938858ae4d76b945f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: paspale-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb16aded40a177d8554576b5f62230a23a86dd06b87e7240ad34db7818690513
MD5 50fea3c02a8bb1e75d94f3d8773d5d25
BLAKE2b-256 07151009d2909ecd2b1c40edd17edd2e88aac3633ce91bb40553d2090964e5b1

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