clean_charts
Version: 0.12.1 ยท License: MIT ยท Python: โฅ 3.8
clean_charts is a Python library for generating premium, publication-quality charts inspired by the clean aesthetics of McKinsey, BCG, and The Economist. Built on top of Matplotlib, it provides high-level functions that produce polished, presentation-ready visualizations with a single function call.
Installation
Dependencies (installed automatically):
matplotlib โฅ 3.5.0, pandas โฅ 1.3.0, numpy โฅ 1.20.0, Pillow โฅ 8.0.0, scipy โฅ 1.7.0, geopandas โฅ 0.10.0
Quick Start
import clean_charts as cc
import pandas as pd
# Plot with built-in sample data
cc.plot_time_series(title="Market Trends", subtitle="Monthly index")
# Plot with your own data
df = pd.DataFrame({"Category": ["A", "B", "C"], "Value": [42, 31, 18]})
cc.plot_barh_chart(data=df, title="My Chart", output_path="chart.png")
Architecture
clean_charts/
โโโ __init__.py # Public API re-exports
โโโ config.py # Design tokens (colors, fonts, sizes)
โโโ data.py # Default sample data & DataFrame conversion
โโโ _helpers.py # Shared utilities (display, save, gradients)
โโโ fonts/ # Bundled Inter font files
โโโ plots/ # Core charting functions
โโโ time_series.py
โโโ barh.py, barv.py, grouped_barh.py, stacked_bar.py
โโโ scatter.py, grouped_scatter.py, bubble_scatter.py
โโโ donut.py, waffle.py, dumbbell.py
โโโ insight_card.py, bubble_matrix.py, table.py
โโโ geofacet.py, dashboard.py
Chart Gallery
Explore the full library of chart types:
Bar Charts
Time Series
| Function |
Description |
plot_time_series() |
Multi-series line charts with annotations and splines |
Scatter Plots
Matrix & Grid
Proportions
Comparisons
Presentation