Skip to main content

Plotify

Plotify is a Python plotting package built around two ideas:

  1. Auto-pick — given a dataframe and column names, Plotify infers the right chart from the data shape and types. No need to remember which function to call.
  2. Publication-ready by default — every chart ships with a colourblind-safe palette, smart tick formatting (1.2K, 3.4M), minimalist spines, and consistent typography on both backends.

Every plot can render on either Seaborn/Matplotlib (static images) or Plotly (interactive HTML).

The chart catalogue and category split (Numerical, Categoric, Num & Cat, Time series, Network, Maps) are inspired by data-to-viz.com.

Demo notebooks

The fastest way to see what Plotify can do — runnable notebooks under notebooks/ with every chart class rendered on both backends:

Outputs are committed, so the notebooks render fully on GitHub without running them.

Two-line example

import pandas as pd, plotify

df = pd.DataFrame({
    "date": pd.date_range("2024-01-01", periods=12, freq="MS"),
    "sales": [120, 140, 90, 200, 220, 260, 240, 310, 280, 330, 360, 410],
    "region": ["North"] * 6 + ["South"] * 6,
})

plotify.auto(df, x="date", y="sales", color="region", backend="plotly")\
       .save_plot("sales.html")

plotify.auto looks at the dtypes (datetime, numeric, low-cardinality group), picks LineChart, and returns a beautifully themed figure.

What auto actually picks

plotify.suggest(df, x="date", y="sales", color="region")
# → [Suggestion(LineChart,        score=0.96, reason="datetime x + numeric y + low-cardinality group → multi-series line chart"),
#    Suggestion(StackedAreaChart, score=0.72, reason="stacked area variant for compositional time series")]

Suggestions come ranked, each with a one-line reason — useful for debugging or for showing the user why a chart was picked.

You can also pass an intent to override the rules:

plotify.auto(df, x="region", y="sales", intent="distribution")
# → Violinplot

Themes

plotify.theme controls the look of every chart on both backends.

import plotify

plotify.theme.get_current().name      # "publication" — applied automatically
plotify.theme.set("none")             # opt out, use library defaults
plotify.theme.register(plotify.theme.Theme(name="brand", palette=("#FF1493", "#00CED1")))
plotify.theme.set("brand")

Package structure

plotify/
├── base.py              # BasePlot — backend dispatch + save
├── numerical/           # Boxplot, DensityPlot, Violinplot, ScatterPlot, ConnectedScatterPlot
├── categorical/         # BarPlot, PieChart, Treemap, Sunburst, Venn, Dendrogram, etc. (12)
├── num_cat/             # GroupedBarPlot, StackedBarPlot, GroupedScatter, BoxPlotByGroup
├── timeseries/          # LineChart, AreaChart, StackedAreaChart, StreamGraph
├── network/             # NetworkDiagram, ChordDiagram, SankeyDiagram, ArcDiagram, HierarchicalEdgeBundling
└── maps/                # ChoroplethMap, BubbleMap, HexbinMap, Cartogram, ConnectionMap

Installation

pip install plotify-charts          # PyPI distribution name
pip install plotify-charts[maps]    # adds geopandas for ChoroplethMap's seaborn path
pip install plotify-charts[full]    # all optional extras

The Python import name is plotify regardless of which install variant you pick:

import plotify

If you've cloned the repo for development, install with Poetry instead:

poetry install --with dev --extras full

Usage

import pandas as pd
from plotify.numerical import Boxplot
from plotify.categorical import BarPlot, PieChart
from plotify.timeseries import LineChart
from plotify.network import SankeyDiagram

df = pd.DataFrame({"cat": list("AAABBB"), "val": [1, 2, 3, 4, 5, 6]})

# Seaborn/Matplotlib backend → static image.
Boxplot(df, x="cat", y="val", backend="seaborn").save_plot("box.png")

# Plotly backend → interactive HTML (or static image via kaleido).
BarPlot(df, x="cat", y="val", backend="plotly").save_plot("bar.html")
PieChart(df, names="cat", values="val", backend="plotly").save_plot("pie.html")

# Sankey flow with explicit source/target/value lists.
SankeyDiagram(
    source=[0, 1, 0],
    target=[2, 2, 3],
    value=[8, 4, 2],
    labels=["A", "B", "C", "D"],
    backend="plotly",
).save_plot("sankey.html")

Every plot class accepts backend="seaborn" (default) or backend="plotly". A few classes only support one backend — WordCloudPlot, VennDiagram, CircularPacking, StreamGraph, ChordDiagram, ArcDiagram, HierarchicalEdgeBundling, and Cartogram are Seaborn-only because Plotly has no native equivalent. Requesting an unsupported backend raises a ValueError at construction time.

Chart catalogue (all implemented)

Category Classes
Numerical Boxplot, DensityPlot, Violinplot, ScatterPlot, ConnectedScatterPlot
Categoric BarPlot, LollipopChart, RadarChart, ParallelCoordinates, WordCloudPlot, PieChart, DoughnutChart, Treemap, CircularPacking, SunburstDiagram, VennDiagram, Dendrogram
Num & Cat GroupedBarPlot, StackedBarPlot, GroupedScatter, BoxPlotByGroup
Time series LineChart, AreaChart, StackedAreaChart, StreamGraph
Network NetworkDiagram, ChordDiagram, SankeyDiagram, ArcDiagram, HierarchicalEdgeBundling
Maps ChoroplethMap, BubbleMap, HexbinMap, Cartogram, ConnectionMap

Development

Run the test suite:

poetry run pytest

The notebooks under notebooks/ are generated from scripts/build_notebooks.py — please don't hand-edit them. After changing an API or a chart class, rebuild and re-execute in a single step:

python scripts/build_notebooks.py --execute

The --execute flag runs each notebook via jupyter nbconvert so the rendered outputs are embedded in the committed .ipynb files. The script sets PYTHONPATH to the repo root automatically, so it works without pip-installing the package.

Metadata

Release files for plotify-charts 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plotify-charts 0.1.0
File Size Uploaded
plotify_charts-0.1.0.tar.gz 42.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for plotify-charts 0.1.0
File Interpreter ABI Platform
plotify_charts-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 114.5 kB

Release files / plotify_charts-0.1.0.tar.gz

Download URL plotify_charts-0.1.0.tar.gz
Size 42.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ff8d082c5eb5465dc0da418b61ade8f7f2aa4cf7314b9d8b640f3dc88e979549
BLAKE2b-256 checksum
How to use checksums
7e983284b61b69d827657c1ab3fa34e0399963f18ad7b160be499084bf2bde40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.12.7 Windows/11

Release files / plotify_charts-0.1.0-py3-none-any.whl

Download URL plotify_charts-0.1.0-py3-none-any.whl
Size 71.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a78d4e8c9d31f720ff90331fd37ec3814b0b9483cceeb065bbf79f6aa3a0798d
BLAKE2b-256 checksum
How to use checksums
8f81bb0df5abb9f02c50aa18a99ee7785f5e24636de3f9d25ca7d820c2cd0afc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.12.7 Windows/11

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page