Skip to main content

Publication-ready plotting library for ML papers

Project description

📄📊 Swizz

Version License: MIT Docs Python Built for Papers

Logo

Swizz is a Python library for generating publication-ready visualizations, LaTeX tables, and subfigure layouts with minimal code and consistent style. Check out the live docs for examples and usage.

Built for AI/ML researchers, it's designed to make NeurIPS/ICLR/CVPR-style figures effortless — no more LaTeX hacks and style mismatches. Focus on your results, not your rendering.

If you use Swizz in your research, please consider citing it using:

@software{quaedvlieg2025swizz,
  author = {Quaedvlieg, Lars and Miele, Andrea},
  license = {MIT},
  month = apr,
  title = {{Swizz: Publication-ready plots and LaTeX tables for ML papers}},
  url = {https://github.com/lars-quaedvlieg/swizz},
  version = {0.1.0},
  year = {2025}
}

🚀 Features

  • 🧾 Auto-generated LaTeX tables from your data
  • 📊 One-liner plotting functions
  • 🧩 Easy layout builders for stacked, grid, and subfigure formats
  • 📚 Expanding Jupyter Book documentation with live examples

📦 Installation

git clone git@github.com:lars-quaedvlieg/swizz.git swizz
cd swizz
pip install .

(Coming soon to PyPI)


📁 Project Structure

Module Description
swizz.table Table generators
swizz.plot Plotting utilities built on Seaborn & Matplotlib
swizz.layout Layout builders for stacked / side-by-side images

🧪 Examples

Multi-level table example:

from swizz.table import table

complex_df = ...

latex_string = table(
    "grouped_multicol_latex",
    df=complex_df,
    row_index="Model",
    col_index=["Split", "Budget"],
    groupby="Task",
    value_column="score",
    highlight="min",
    stderr=True,
    caption="Combinatorial optimization results",
    label="tab:combo_results"
)

Complex Table

Simple bar chart example:

from matplotlib import pyplot as plt
from swizz import plot

data_dict = ...

# Style map for each metric (hatch patterns for filling)
style_map = {
    "Accuracy": '',
    "Precision": '\\',
    "Recall": 'x'  # Cross hatch pattern for Recall
}

plot("general_bar_plot", data_dict, style_map=style_map, save="bar")
plt.show()

Bar Chart

Complex nested layouts:

from swizz.layouts.blocks import Row, Col, LegendBlock, Label
from swizz.layouts import render_layout
from matplotlib import pyplot as plt

plot1, plot2, plot3 = ...

nested_layout = Col([
    Row([
        LegendBlock(labels=["Accuracy", "Precision", "Recall"], ncol=3, fixed_width=0.35),
        LegendBlock(labels=["Forward KL", "Reverse KL"], ncol=2)
    ], fixed_height=0.08, spacing=0.15),
    Row([
        Col([
            plot3,
            Label("(a) Bar chart", align="center", fixed_height=0.05),
        ]),
        Col([
            plot1,
            Label("(b) Line plot 1", align="center", fixed_height=0.05),
            plot2,
            Label("(c) Line plot 2", align="center", fixed_height=0.05)
        ], spacing=0.07)
    ], spacing=0.1),
], spacing=0.02)

fig = render_layout(nested_layout, figsize=(10, 8))
plt.show()

Complex Layout


🛠️ Roadmap

  • Add more plot types (confusion, UMAP, attention, histograms, etc.)
  • Add Manim integrations for dynamic plot videos and function evolutions, etc.
  • Add more tables
  • W&B / MLflow integration

🤝 Contributing

Contributions are very welcome! See CONTRIBUTING.md for setup and module structure.


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

swizz-0.1.0.tar.gz (28.0 kB view details)

Uploaded Source

Built Distribution

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

swizz-0.1.0-py3-none-any.whl (37.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: swizz-0.1.0.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for swizz-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7f3436921d36c98f91843486796e1e4fe6eb4b1d5835b853e521dd1666938941
MD5 e441db3d5f5ba1220aa7d01986e78859
BLAKE2b-256 00d90fcbf9875bfcd7e7800ad102f5021434d9b1c14876804c4a3ed20085ee2a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: swizz-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 37.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for swizz-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6614ec1199cac534f98a9269f95ae3c42c51cc6683d3cb890ca99e96f261d09d
MD5 044b466769ccb5f0818069a0f1b1a56a
BLAKE2b-256 b82b8620448bd2a141378eadb737f3b95d649e9d921d487535fbf23d9e81ec22

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