# Python charting libraries

Python charting libraries turn data in lists, arrays, or DataFrames into line, bar, scatter, and other charts. An interactive renderer outputs HTML and JavaScript with zoom and hover instead of a static image. These libraries let analysts, notebooks, and dashboards present data as figures.

## Popularity

| Library | Monthly downloads | Stars | Last release | License |
| --- | --- | --- | --- | --- |
| [Matplotlib](#matplotlib) | 196.4M | 23.5K | Sep 2026 | Matplotlib |
| [Plotly](#plotly) | 60.0M | 18.9K | Sep 2026 | MIT |
| [Altair](#altair) | 43.5M | 10.5K | Sep 2026 | BSD-3-Clause |
| [seaborn](#seaborn) | 31.6M | 14.1K | Jan 2024 | BSD-3-Clause |
| [Bokeh](#bokeh) | 6.5M | 20.5K | Nov 2026 | BSD-3-Clause |
| [plotnine](#plotnine) | 1.7M | 4.8K | Nov 2026 | MIT |
| [PyQtGraph](#pyqtgraph) | 1.0M | 4.4K | Nov 2025 | MIT |
| [pyecharts](#pyecharts) | 823.9K | 15.8K | Feb 2026 | MIT |

Downloads: PyPI, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

[Matplotlib](#matplotlib) has the most monthly downloads in this comparison, at 188.1M.

## Capabilities

| Library | Interactive HTML export | PNG export |
| --- | --- | --- |
| [Matplotlib](#matplotlib) | No | Yes |
| [Plotly](#plotly) | Yes | Via plugin |
| [Altair](#altair) | Yes | Via plugin |
| [seaborn](#seaborn) | No | Yes |
| [Bokeh](#bokeh) | Yes | Via plugin |
| [plotnine](#plotnine) | No | Yes |
| [PyQtGraph](#pyqtgraph) | No | Yes |
| [pyecharts](#pyecharts) | Yes | Via plugin |

## Libraries

### Matplotlib

[GitHub](https://github.com/matplotlib/matplotlib) · [PyPI](https://pypi.org/project/matplotlib) · [Docs](https://matplotlib.org)

Creates static, animated, and interactive visualizations.

- Downloads / mo: 196.4M
- Stars: 23.5K
- Last release: 3.11.2
- License: Matplotlib
- Capabilities: [From the Matplotlib docs](https://matplotlib.org)

**Strengths**

- **Creates static and interactive figures.** Use the same plotting library for image files and interactive windows.
- **Exports publication image formats.** Save figures as PNG, PDF, or SVG.

**Watch out for**

- **Interactivity needs an appropriate backend.** Choose an interactive backend for live windows instead of image-only output.

```sh
pip install matplotlib
```

**arviz-devs/arviz** (1.9K stars)

[arviz-devs/arviz](https://github.com/arviz-devs/arviz) 

```python
def _histplot_mpl_op(values, values2, rotated, ax, hist_kwargs, is_circular):
    """Add a histogram for the data to the axes."""
    bins = hist_kwargs.pop("bins", None)

    if is_circular == "degrees":
        if bins is None:
            bins = get_bins(values)
        values = np.deg2rad(values)
        bins = np.deg2rad(bins)

    elif is_circular:
        labels = [
            "0",
            f"{np.pi/4:.2f}",
            f"{np.pi/2:.2f}",
            f"{3*np.pi/4:.2f}",
            f"{np.pi:.2f}",
            f"{-3*np.pi/4:.2f}",
            f"{-np.pi/2:.2f}",
            f"{-np.pi/4:.2f}",
        ]

        ax.set_xticklabels(labels)

    if values2 is not None:
        raise NotImplementedError("Insert hexbin plot here")

    if bins is None:
        bins = get_bins(values)

    if values.dtype.kind == "i":
        hist_kwargs.setdefault("align", "left")
    else:
        hist_kwargs.setdefault("align", "mid")

    n, bins, _ = ax.hist(np.asarray(values).flatten(), bins=bins, **hist_kwargs)

    if values.dtype.kind == "i":
        ticks = bins[:-1]
    else:
        ticks = (bins[1:] + bins[:-1]) / 2

    if rotated:
        ax.set_yticks(ticks)
    elif not is_circular:
        ax.set_xticks(ticks)

    if is_circular:
        ax.set_ylim(0, 1.5 * n.max())
        ax.set_yticklabels([])

    if hist_kwargs.get("label") is not None:
        ax.legend()

    return ax
```

[arviz/plots/backends/matplotlib/distplot.py](https://github.com/arviz-devs/arviz/blob/35fa479d617aa82dbe005af12fab6b37146e8c5b/arviz/plots/backends/matplotlib/distplot.py#L124-L178) · [More projects using Matplotlib →](https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20matplotlib%20to%20render%20charts%2C%20plot%20distributions%20and%20export%20visualizations&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```python
import matplotlib.pyplot as plt
plt.plot([1, 2, 3], [1, 4, 9])
plt.show()

```

From [pyplot.html](https://matplotlib.org/stable/tutorials/pyplot.html)

### Plotly

[GitHub](https://github.com/plotly/plotly.py) · [PyPI](https://pypi.org/project/plotly) · [Docs](https://plotly.com/python/)

Creates interactive browser-based charts from Python.

- Downloads / mo: 60.0M
- Stars: 18.9K
- Last release: 7.1.0
- License: MIT
- Capabilities: [From the Plotly docs](https://plotly.com/python/)

**Strengths**

- **Shares interactive HTML files.** Keep hover, zoom, and trace controls when sharing browser-readable charts.
- **Fits Dash applications.** Embed Python figures in analytical web applications built with Dash.

**Watch out for**

- **Static export needs browser dependencies.** Install Kaleido and compatible Chrome or Chromium to produce image files.

```sh
pip install plotly
```

**gradio-app/gradio** (44.1K stars)

[gradio-app/gradio](https://github.com/gradio-app/gradio) 

```python
def create_pip_plot(libraries, pip_choices):
    if "Pip" not in pip_choices:
        return gr.Plot(visible=False)
    output = retrieve_pip_installs(libraries, "Cumulated" in pip_choices)
    df = pd.DataFrame(output).melt(id_vars="day")
    plot = px.line(df, x="day", y="value", color="variable",
                   title="Pip installs")
    plot.update_layout(legend=dict(x=0.5, y=0.99),  title_x=0.5, legend_title_text="")
    return gr.Plot(value=plot, visible=True)
```

[demo/dashboard/run.py](https://github.com/gradio-app/gradio/blob/ec06278ed72e5eb73494a9d171ca851d553dc82a/demo/dashboard/run.py#L9-L17) · [More projects using Plotly →](https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20plotly%20to%20render%20charts%2C%20plot%20distributions%20and%20export%20visualizations&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```python
import plotly.express as px
fig = px.bar(x=["a", "b", "c"], y=[1, 3, 2])
fig.show()

```

From [json.md](https://pypi.org/pypi/plotly/7.1.0/json#info.description)

### Altair

[GitHub](https://github.com/vega/altair) · [PyPI](https://pypi.org/project/altair) · [Docs](https://altair-viz.github.io)

Defines declarative statistical charts using Vega and Vega-Lite.

- Downloads / mo: 43.5M
- Stars: 10.5K
- Last release: 6.3.0
- License: BSD-3-Clause
- Capabilities: [From the Altair docs](https://altair-viz.github.io)

**Strengths**

- **Maps data columns to visuals.** Declare encoding channels and let the chart grammar handle plot details.
- **Links notebook charts with Python.** Observe selections and update displayed charts through JupyterChart.

**Watch out for**

- **Large embedded datasets trigger errors.** Enable VegaFusion or aggregate data before embedding it in a chart.
- **Image export needs another package.** Install vl-convert-python for images or offline HTML files.

```sh
pip install altair
```

**holoviz/panel** (5.8K stars)

[holoviz/panel](https://github.com/holoviz/panel) 

```python
def _altair_to_dict(obj):
    import altair as alt

    # The vegafusion transformer makes Altair refuse any other format
    if alt.data_transformers.active == 'vegafusion':
        return obj.to_dict(format='vega')
    return obj.to_dict()
```

[panel/pane/vega.py](https://github.com/holoviz/panel/blob/e5979d3e7bdd5ea76452f8e5ecc69d24c18065ab/panel/pane/vega.py#L174-L180) · [More projects using Altair →](https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20altair%20to%20render%20charts%2C%20plot%20distributions%20and%20export%20visualizations&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```python
import altair as alt
chart = alt.Chart(alt.Data(values=[{"x": "A", "y": 1}, {"x": "B", "y": 3}])).mark_bar().encode(x="x:N", y="y:Q")
chart.save("chart.html")

```

From [jupyter_chart.html](https://altair-viz.github.io/getting_started/overview.html)

### seaborn

[GitHub](https://github.com/mwaskom/seaborn) · [PyPI](https://pypi.org/project/seaborn) · [Docs](https://pypi.org/project/seaborn/)

Draws statistical data visualizations.

- Downloads / mo: 31.6M
- Stars: 14.1K
- Last release: 0.13.2
- License: BSD-3-Clause
- Capabilities: [From the seaborn docs](https://pypi.org/project/seaborn/)

```sh
pip install seaborn
```

**Data-Centric-AI-Community/fg-data-profiling** (13.8K stars)

[Data-Centric-AI-Community/fg-data-profiling](https://github.com/Data-Centric-AI-Community/fg-data-profiling) 

```python
def missing_heatmap(
    corr_mat: Any,
    mask: Any,
    figsize: Tuple[float, float] = (20, 12),
    fontsize: float = 16,
    labels: bool = True,
    label_rotation: int = 45,
    cmap: str = "RdBu",
    normalized_cmap: bool = True,
    cbar: bool = True,
    ax: matplotlib.axis.Axis = None,
) -> matplotlib.axis.Axis:
    """
    Presents a `seaborn` heatmap visualization of missing data correlation.
    Note that this visualization has no special support for large datasets.

    Inspired by https://github.com/ResidentMario/missingno

    Args:
        corr_mat: correlation matrix.
        mask: Upper-triangle mask.
        figsize: The size of the figure to display. Defaults to (20, 12).
        fontsize: The figure's font size.
        labels: Whether or not to label each matrix entry with its correlation (default is True).
        label_rotation: What angle to rotate the text labels to. Defaults to 45 degrees.
        cmap: Which colormap to use. Defaults to `RdBu`.
        normalized_cmap: Use a normalized colormap threshold or not. Defaults to True
    Returns:
        The plot axis.
    """
    _, ax = plt.subplots(1, 1, figsize=figsize)
    norm_args = {"vmin": -1, "vmax": 1} if normalized_cmap else {}

    if labels:
        sns.heatmap(
            corr_mat,
            mask=mask,
            cmap=cmap,
            ax=ax,
            cbar=cbar,
            annot=True,
            annot_kws={"size": fontsize - 2},
            **norm_args,
        )
    else:
        sns.heatmap(corr_mat, mask=mask, cmap=cmap, ax=ax, cbar=cbar, **norm_args)

    # Apply visual corrections and modifications.
    ax.xaxis.tick_bottom()
    ax.set_xticklabels(
        ax.xaxis.get_majorticklabels(),
        rotation=label_rotation,
        ha="right",
        fontsize=fontsize,
    )
    ax.set_yticklabels(ax.yaxis.get_majorticklabels(), rotation=0, fontsize=fontsize)
    ax = _set_visibility(ax)
    ax.patch.set_visible(False)

    for text in ax.texts:
        t = float(text.get_text())
        if 0.95 <= t < 1:
            text.set_text("<1")
        elif -1 < t <= -0.95:
            text.set_text(">-1")
        elif t == 1:
            text.set_text("1")
        elif t == -1:
            text.set_text("-1")
        elif -0.05 < t < 0.05:
            text.set_text("")
        else:
            text.set_text(round(t, 1))

    return ax
```

[src/data_profiling/visualisation/plot.py](https://github.com/Data-Centric-AI-Community/fg-data-profiling/blob/c27f8dcf54ba9e382b4dd235d61ef1acbe3926b9/src/data_profiling/visualisation/plot.py#L1084-L1158) · [More projects using seaborn →](https://dashboard.exa.ai/playground/search?q=seaborn%20GitHub%20projects)

**Quickstart**

```python
import seaborn as sns
import matplotlib.pyplot as plt
sns.scatterplot(x=[1, 2, 3], y=[1, 4, 9])
plt.show()

```

From [seaborn.scatterplot.html](https://seaborn.pydata.org/generated/seaborn.scatterplot.html)

### Bokeh

[GitHub](https://github.com/bokeh/bokeh) · [PyPI](https://pypi.org/project/bokeh) · [Docs](https://pypi.org/project/bokeh/)

Creates interactive JavaScript-powered visualizations from Python.

- Downloads / mo: 6.5M
- Stars: 20.5K
- Last release: 3.10.2
- License: BSD-3-Clause
- Capabilities: [From the Bokeh docs](https://pypi.org/project/bokeh/)

**Strengths**

- **Runs live Python callbacks.** Serve applications that synchronize Python models with connected browsers.
- **Includes browser exploration tools.** Pan, zoom, and reset charts through built-in browser controls.

**Watch out for**

- **Two-way Python interaction needs hosting.** Run a Bokeh server to receive interactive browser updates in Python.
- **Image export needs browser dependencies.** Install a headless browser backend for PNG or SVG export.

```sh
pip install bokeh
```

**arviz-devs/arviz** (1.9K stars)

[arviz-devs/arviz](https://github.com/arviz-devs/arviz) 

```python
def _histplot_bokeh_op(values, values2, rotated, ax, hist_kwargs, is_circular):
    """Add a histogram for the data to the axes."""
    if values2 is not None:
        raise NotImplementedError("Insert hexbin plot here")

    color = hist_kwargs.pop("color", False)
    if color:
        hist_kwargs["fill_color"] = color
        hist_kwargs["line_color"] = color

    bins = hist_kwargs.pop("bins", None)
    if bins is None:
        bins = get_bins(values)
    hist, hist_dens, edges = histogram(np.asarray(values).flatten(), bins=bins)
    if hist_kwargs.pop("density", True):
        hist = hist_dens
    if hist_kwargs.pop("cumulative", False):
        hist = np.cumsum(hist)
        hist /= hist[-1]
    if values.dtype.kind == "i":
        edges = edges.astype(float) - 0.5

    if is_circular:
        if is_circular == "degrees":
            edges = np.deg2rad(edges)
            labels = ["0°", "45°", "90°", "135°", "180°", "225°", "270°", "315°"]
        else:
            labels = [
                r"0",
                r"π/4",
                r"π/2",
                r"3π/4",
                r"π",
                r"5π/4",
                r"3π/2",
                r"7π/4",
            ]

        delta = np.mean(np.diff(edges) / 2)

        ax.annular_wedge(
            x=0,
            y=0,
            inner_radius=0,
            outer_radius=hist,
            start_angle=edges[1:] - delta,
            end_angle=edges[:-1] - delta,
            direction="clock",
            **hist_kwargs,
        )

        ax = set_bokeh_circular_ticks_labels(ax, hist, labels)
    elif rotated:
        ax.quad(top=edges[:-1], bottom=edges[1:], left=0, right=hist, **hist_kwargs)
    else:
        ax.quad(top=hist, bottom=0, left=edges[:-1], right=edges[1:], **hist_kwargs)

    return ax
```

[arviz/plots/backends/bokeh/distplot.py](https://github.com/arviz-devs/arviz/blob/35fa479d617aa82dbe005af12fab6b37146e8c5b/arviz/plots/backends/bokeh/distplot.py#L126-L183) · [More projects using Bokeh →](https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20bokeh%20to%20render%20charts%2C%20plot%20distributions%20and%20export%20visualizations&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```python
from bokeh.plotting import figure, show
p = figure()
p.line([1, 2, 3], [1, 4, 9])
show(p)

```

From [stats.html](https://docs.bokeh.org/en/latest/docs/first_steps/first_steps_1.html)

### plotnine

[GitHub](https://github.com/has2k1/plotnine) · [PyPI](https://pypi.org/project/plotnine) · [Docs](https://pypi.org/project/plotnine/)

Implements a grammar of graphics for Python.

- Downloads / mo: 1.7M
- Stars: 4.8K
- Last release: 0.15.9
- License: MIT
- Capabilities: [From the plotnine docs](https://pypi.org/project/plotnine/)

```sh
pip install plotnine
```

**awesome-panel/awesome-panel** (354 stars)

[awesome-panel/awesome-panel](https://github.com/awesome-panel/awesome-panel) 

```python
def get_plot(theme="default"):
    """Returns a Plotnine Figure"""
    plt.style.use("default")
    if theme == "dark":
        plotnine_theme = themes.theme_dark() + themes.theme(
            plot_background=element_rect(fill="black", alpha=0)
        )
    else:
        plotnine_theme = themes.theme_xkcd()

    plot = (
        (
            ggplot(mtcars, aes("wt", "mpg", color="factor(gear)"))
            + geom_point()
            + stat_smooth(method="lm")
            + facet_wrap("~gear")
        )
        + plotnine_theme
        + themes.theme(figure_size=(16, 8))
    )
    return plot.draw()
```

[examples/lib_plotnine.py](https://github.com/awesome-panel/awesome-panel/blob/f749ee7cb0c26353b857d3042a1746af6205cced/examples/lib_plotnine.py#L25-L45) · [More projects using plotnine →](https://dashboard.exa.ai/playground/search?q=plotnine%20GitHub%20projects)

**Quickstart**

```python
from plotnine import ggplot, aes, geom_point
from plotnine.data import mtcars
plot = ggplot(mtcars, aes('wt', 'mpg')) + geom_point()
plot.show()

```

From [json#info.description](https://pypi.org/pypi/plotnine/0.15.9/json#info.description)

### PyQtGraph

[GitHub](https://github.com/pyqtgraph/pyqtgraph) · [PyPI](https://pypi.org/project/pyqtgraph) · [Docs](https://pyqtgraph.readthedocs.io)

Provides scientific graphics and GUI tools for Python.

- Downloads / mo: 1.0M
- Stars: 4.4K
- Last release: 0.14.0
- License: MIT
- Capabilities: [From the PyQtGraph docs](https://pyqtgraph.readthedocs.io)

```sh
pip install pyqtgraph PySide6
```

**Quickstart**

```python
import pyqtgraph as pg
app = pg.mkQApp()
plot = pg.plot([1, 2, 3], [1, 4, 9])
pg.exec()

```

From [how_to_use.html](https://pyqtgraph.readthedocs.io/en/latest/getting_started/how_to_use.html) · [Find projects using PyQtGraph →](https://dashboard.exa.ai/playground/search?q=pyqtgraph%20GitHub%20projects)

### pyecharts

[GitHub](https://github.com/pyecharts/pyecharts) · [PyPI](https://pypi.org/project/pyecharts) · [Docs](https://pypi.org/project/pyecharts/)

Builds charts from Python options.

- Downloads / mo: 823.9K
- Stars: 15.8K
- Last release: 2.1.0
- License: MIT
- Capabilities: [From the pyecharts docs](https://pypi.org/project/pyecharts/)

```sh
pip install pyecharts
```

**FinMind/FinMind** (2.9K stars)

[FinMind/FinMind](https://github.com/FinMind/FinMind) 

```python
def bar(
    labels: typing.Union[typing.List[typing.Union[str, int]], Labels],
    series: typing.Union[typing.List[typing.Union[int, float]], Series],
    y_series_name: str = "",
    y_axis_name: str = "億",
    yaxis_color: str = "#dca540",
    title: str = "title",
    width: str = "800px",
    height: str = "600px",
    filename: str = "bar.html",
):
    """plot bar
    :param: bar_plot_data (:obj:FinMind.BarPlotSchema)
    BarPlotSchema(labels=labels, series=series)
    :param: y_series_name (str) default ''
    :param: y_axis_name (str) default "億"
    :param: yaxis_color (str) default "#dca540"
    :param: title (str) default "title"
    :param: width (str) default "800px"
    :param: height (str) default "600px"
    :param: filename (str) default "bar.html", output filename

    :return: display bar
    :rtype pyecharts.charts.Bar
    """
    labels, series = convert_labels_series_schema(labels, series)
    bar_plot = (
        Bar(opts.InitOpts(width=width, height=height))
        .add_xaxis(labels.labels)
        .add_yaxis(
            series_name=y_series_name,
            y_axis=series.series,
            itemstyle_opts=opts.ItemStyleOpts(color=yaxis_color),
        )
        .set_global_opts(
            title_opts=opts.TitleOpts(title=title),
            datazoom_opts=[
                opts.DataZoomOpts(xaxis_index=[0]),
                opts.DataZoomOpts(xaxis_index=[0], type_="inside"),
            ],
            yaxis_opts=opts.AxisOpts(
                axislabel_opts=opts.LabelOpts(
                    formatter=f"{{value}}{y_axis_name}"
                ),
            ),
            tooltip_opts=opts.TooltipOpts(
                trigger="axis", axis_pointer_type="cross"
            ),
        )
        .set_series_opts(
            markpoint_opts=opts.MarkPointOpts(),
        )
    )
    bar_plot.render(filename)
    display(HTML(filename=filename))
    return bar_plot
```

[FinMind/plotting/bar.py](https://github.com/FinMind/FinMind/blob/28baf6b289fcc7f023300c52a8028dab7a6c31f9/FinMind/plotting/bar.py#L10-L65) · [More projects using pyecharts →](https://dashboard.exa.ai/playground/search?q=pyecharts%20GitHub%20projects)

**Quickstart**

```python
from pyecharts.charts import Bar
bar = Bar().add_xaxis(['A', 'B']).add_yaxis('Count', [1, 3])
bar.render('chart.html')

```

From [README.en.md](https://raw.githubusercontent.com/pyecharts/pyecharts/v2.1.0/README.en.md)

## FAQ

### Which Python charting library should I use?

[Matplotlib](#matplotlib) suits publication figures and fine control over every element. [Plotly](#plotly) suits interactive charts in notebooks and web dashboards. [seaborn](#seaborn) suits statistical charts drawn from DataFrames with little code.

### What is Matplotlib?

[Matplotlib](#matplotlib) is the foundational Python plotting library for static, animated, and interactive figures. pandas and seaborn draw their charts with it.

### What is Bokeh?

[Bokeh](#bokeh) creates interactive visualizations from Python that render in the browser with JavaScript. It supports streaming data and server-backed apps.

### What is seaborn?

[seaborn](#seaborn) is a statistical visualization library built on Matplotlib. It draws distribution, regression, and categorical plots directly from DataFrames.

### Plotly vs Matplotlib: which should I use?

[Matplotlib](#matplotlib) draws static images by default and gives low-level control. [Plotly](#plotly) renders interactive HTML charts with zoom and hover built in.

### Seaborn vs Matplotlib: what is the difference?

[seaborn](#seaborn) is built on [Matplotlib](#matplotlib) and adds statistical chart types with styled defaults. Matplotlib remains the layer for fine-tuning each figure.

## How this page was built

Data checked Nov 20, 2026.

Reproduce it with the Exa API:

```json
{
  "endpoint": "/search",
  "body": {
    "query": "Best Python charting libraries Matplotlib Plotly Bokeh Altair plotting data visualization code examples",
    "numResults": 5
  }
}
```

Docs: https://exa.ai/docs/reference/search
