swizz
Modular Python package for simple visualization and ML pipelines.
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (16.7%) to scientific vocabulary
Keywords
Repository
Modular Python package for simple visualization and ML pipelines.
Basic Info
- Host: GitHub
- Owner: lars-quaedvlieg
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://lars-quaedvlieg.github.io/swizz/
- Size: 14 MB
Statistics
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 2
Topics
Metadata Files
README.md
📄📊 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:
bibtex
@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
- 🎬 Manim animations for dynamic visualizations and function evolutions
- 📈 Weights & Biases integration for experiment tracking and analysis
📦 Installation
Via PyPi:
bash
pip install swizz
By cloning the repository:
bash
git clone git@github.com:lars-quaedvlieg/swizz.git swizz
cd swizz
pip install .
📁 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 |
| swizz.manim | Dynamic visualizations and animations |
| swizz.logging | Experiment tracking with Weights & Biases |
🧪 Examples
Multi-level table example:
```python from swizz.table import table
complex_df = ...
latexstring = table(
"groupedmulticollatex",
df=complexdf,
rowindex="Model",
colindex=["Split", "Budget"],
groupby="Task",
valuecolumn="score",
highlight="min",
stderr=True,
caption="Combinatorial optimization results",
label="tab:comboresults"
)
```
Simple bar chart example:
```python 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("generalbarplot", datadict, stylemap=style_map, save="bar")
plt.show()
```
Weights & Biases integration example:
```python from swizz.logging.wandb_analyzer import WandbAnalyzer, RunGroup
Initialize the analyzer
analyzer = WandbAnalyzer("your-username/your-project", verbose=True)
Define run groups (either by prefix or run IDs)
run_groups = [ RunGroup(name="experiment1", prefix="your-prefix-1"), RunGroup(name="experiment2", prefix="your-prefix-2"), ]
Get analyzed metrics
resultsdf = analyzer.computegroupedmetrics( rungroups, xkey="roundnum", ykey="yourmetric" )
Plot the results
figscores, ax = plot( "multiplestdlinesdf", figsize=(8,5), datadf=resultsdf, labelkey="groupname", xkey="roundnum", ykey="yourmetricmean", yerrkey="yourmetricstd", xlabel="Sampling Budget", ylabel="Average Score", legendtitle="Experiments", legendncol=2, legend_loc="lower right" ) plt.show() ```
Manim animation example:
```python from swizz import render_manim import numpy as np import pandas as pd
Create sample data
methods = ['Method A', 'Method B', 'Method C'] iterations = range(30) scores = []
for method in methods: for iteration in iterations: # Generate evolving scores for each method if method == 'Method A': mean = 50 + iteration * 1 std = 10 + iteration * 3 elif method == 'Method B': mean = 40 + iteration * 2 std = 15 + iteration * 0.5 else: # Method C mean = 45 + iteration * 3 std = 12
scores.extend([(method, iteration, score)
for score in np.random.normal(mean, std, 300)])
scores_df = pd.DataFrame(scores, columns=['method', 'iteration', 'score'])
Render the animation
rendermanim(
"histogramsevolution",
renderconfig={
"quality": "highquality",
"format": "mp4",
"savepngs": True,
},
scoresdf=scoresdf,
methodcolumn="method",
iterationcolumn="iteration",
scorecolumn="score",
xmin=0,
xmax=100,
xstep=10,
numbins=60,
xlength=10,
ylength=5,
timebetweeniterations=0.5,
color_dict={
"Method A": "#1f77b4",
"Method B": "#ff7f0e",
"Method C": "#2ca02c",
},
)
```
Complex nested layouts:
```python from swizz.layouts.blocks import Row, Col, LegendBlock, Label from swizz.layouts import render_layout from matplotlib import pyplot as plt
plot1, plot2, plot3 = ...
nestedlayout = Col([ Row([ LegendBlock(labels=["Accuracy", "Precision", "Recall"], ncol=3, fixedwidth=0.35), LegendBlock(labels=["Forward KL", "Reverse KL"], ncol=2) ], fixedheight=0.08, spacing=0.15), Row([ Col([ plot3, Label("(a) Bar chart", align="center", fixedheight=0.05), ]), Col([ plot1, Label("(b) Line plot 1", align="center", fixedheight=0.05), plot2, Label("(c) Line plot 2", align="center", fixedheight=0.05) ], spacing=0.07) ], spacing=0.1), ], spacing=0.02)
fig = renderlayout(nestedlayout, figsize=(10, 8))
plt.show()
```
🛠️ Roadmap
- [ ] Add more plot types (confusion, UMAP, attention, histograms, etc.)
- [x] Add Manim integrations for dynamic plot videos and function evolutions
- [ ] Add more tables
- [x] W&B / MLflow integration
🤝 Contributing
Contributions are very welcome! See CONTRIBUTING.md for setup and module structure.
Owner
- Name: Lars Quaedvlieg
- Login: lars-quaedvlieg
- Kind: user
- Location: Switzerland
- Website: https://lars-quaedvlieg.github.io/
- Repositories: 2
- Profile: https://github.com/lars-quaedvlieg
MSc in Data Science @ EPFL
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use Swizz in your research, please consider citing it using the following metadata."
title: "Swizz: Publication-ready plots and LaTeX tables for ML papers"
version: 0.1.0
authors:
- family-names: Quaedvlieg
given-names: Lars
affiliation: EPFL
orcid: https://orcid.org/0000-0002-0109-5705 # Replace with your ORCID if available
- family-names: Miele
given-names: Andrea
affiliation: EPFL
date-released: 2025-04-15
keywords:
- machine learning
- visualization
- latex
- academic writing
- plots
repository-code: https://github.com/lars-quaedvlieg/swizz
license: MIT
GitHub Events
Total
- Release event: 2
- Watch event: 3
- Delete event: 4
- Push event: 16
- Create event: 3
Last Year
- Release event: 2
- Watch event: 3
- Delete event: 4
- Push event: 16
- Create event: 3
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Lars | l****g@o****m | 49 |
| Andrea Miele | a****o@g****m | 15 |
Issues and Pull Requests
Last synced: 9 months ago
All Time
- Total issues: 0
- Total pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: 13 minutes
- Total issue authors: 0
- Total pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: 13 minutes
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
- andreamiele (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 121 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 5
- Total maintainers: 1
pypi.org: swizz
Publication-ready plotting library for ML papers
- Homepage: https://github.com/lars-quaedvlieg/swizz
- Documentation: https://lars-quaedvlieg.github.io/swizz/
- License: MIT License Copyright (c) 2025 Lars Quaedvlieg Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
Latest release: 0.1.3
published 9 months ago
Rankings
Maintainers (1)
Dependencies
- actions/cache v4 composite
- actions/checkout v4 composite
- actions/deploy-pages v4 composite
- actions/setup-python v5 composite
- actions/upload-pages-artifact v3 composite
- matplotlib >=3.7.5
- numpy >=1.26.4
- omegaconf >=2.3.0
- pandas >=2.2.2
- seaborn >=0.13.2