Publication-ready plotting library for ML papers
Project description
📄📊 Swizz
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"
)
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()
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()
🛠️ 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
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 swizz-0.1.1.tar.gz.
File metadata
- Download URL: swizz-0.1.1.tar.gz
- Upload date:
- Size: 28.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2d4bda8043f5e9fbaa38ad7cd9c6eecab726ec84faf79fe9fd9ce8c4cfe09d1
|
|
| MD5 |
c5f95d463550927197b6c0ed5f8649df
|
|
| BLAKE2b-256 |
46c4ffb59b5c9a617812e8d12da30159db1895f33c341010133a61ed18ecbab6
|
File details
Details for the file swizz-0.1.1-py3-none-any.whl.
File metadata
- Download URL: swizz-0.1.1-py3-none-any.whl
- Upload date:
- Size: 37.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d2c82b64718680203abbd3d59e1798035a50ea59b2e1bfd6e322785679dd589
|
|
| MD5 |
6831ddced4c449b1167ae8b3591163fe
|
|
| BLAKE2b-256 |
84b3814bcf82bb38b157f63c0c11925fce2c7a5d2a4b429905ca056f9efd5b60
|