Data Visualization

Libraries for visualizing data. Also see awesome-javascript.

Charts for print come from Matplotlib, and interactive web ones from Plotly. Put either Python data visualization library in a Streamlit script for a dashboard.

How to choose:

  • Publication figures you control down to the last detail: Matplotlib
  • Interactive charts with little code: Plotly
  • A dashboard or data app from a plain Python script: Streamlit
  • Statistical charts straight from a pandas DataFrame: seaborn
  • Charts you declare by mapping columns to x, y, and color: Vega-Altair
  • Interactive browser plots with full control, or Python code behind them: Bokeh
  • Diagrams of nodes and edges, drawn by Graphviz: graphviz
  • Maps of large areas, in the projection you choose: Cartopy
  • A knowledge graph of your codebase for your AI coding assistant: graphify
  • Dashboards built from callbacks and custom layouts: Dash
  • A demo UI for an ML model or any Python function: Gradio

Listed in editorial order, grouped by use case. Click a column header to re-sort the whole list.

Press / to search. Tags open their category. Click a row for details.

Search and filter

Results

Row number Tags

Plotting 5 projects

A comprehensive library for creating static, animated, and interactive visualizations.
matplotlib/github.com/matplotlib/matplotlib /23,399 stars /
Interactive graphing library for Python.
plotly/github.com/plotly/plotly.py /18,862 stars /
Statistical data visualization using Matplotlib.
mwaskom/github.com/mwaskom/seaborn /14,092 stars /
Declarative statistical visualization library for Python.
vega/github.com/vega/altair /10,508 stars /
Interactive web plotting for Python.
bokeh/github.com/bokeh/bokeh /20,465 stars /

Specialized 3 projects

Simple Python interface for creating and rendering Graphviz graphs.
xflr6/github.com/xflr6/graphviz /1,817 stars /
A cartographic Python library with matplotlib support.
SciTools/github.com/SciTools/cartopy /1,624 stars /
Turns code, SQL schemas, docs, papers, images, or videos into a queryable knowledge graph.

Dashboards and Apps 3 projects

A framework which lets you build dashboards, generate reports, or create chat apps in minutes.
streamlit/github.com/streamlit/streamlit /46,162 stars /
A framework for building data apps and dashboards in pure Python, built on Plotly.
plotly/github.com/plotly/dash /24,474 stars /
Build and share machine learning apps, all in Python.
gradio-app/github.com/gradio-app/gradio /43,926 stars /

Data Visualization guide

Matplotlib makes easy things easy and hard things possible, and it's built for publication-quality plots. Start with fig, ax = plt.subplots() and draw on the Axes it returns. The docs suggest this object-oriented style for complicated plots and for code you'll reuse. The pyplot style, like plt.plot(), is handy for quick interactive work.

Plotly draws interactive charts that show up in Jupyter or run inside Dash apps. Start with Plotly Express, the recommended starting point for most common figures. Every Plotly Express function returns a graph objects Figure, so you can still fine-tune it with update_layout() and add_trace().

Streamlit turns a Python script into a web app: add a few st. calls, then run it with streamlit run. Whenever something on the screen must update, Streamlit reruns your entire script from top to bottom. So wrap slow work in a cached function: st.cache_data for data like a loaded DataFrame or a query result, and st.cache_resource for ML models and database connections.

seaborn builds on Matplotlib and integrates closely with pandas: you name DataFrame columns, and it draws the statistical chart. Its docs recommend figure-level functions like displot() for most plots.

Vega-Altair is declarative: you declare links between data columns and encoding channels like the x-axis, y-axis, and color, and it handles the rest.

Bokeh creates JavaScript-powered visualizations without writing any JavaScript. Build plots with figure() from bokeh.plotting, its primary interface. Add the Bokeh server when your plots need to respond to browser events with Python code, like widgets that rerun a query.

graphviz writes graphs in the DOT language, and renders them with Graphviz, which you install separately. Build a Graph or Digraph, add nodes and edges, then call render() to save the DOT source and the rendered file.

Cartopy draws maps on Matplotlib, and its docs say it's especially useful for large areas, where flat-map assumptions break down at the poles and the dateline. Give the axes a map projection, like plt.axes(projection=ccrs.PlateCarree()), then add coastlines and your data. Your data's coordinate system is separate from that projection, so always pass transform= when you plot.

graphify maps your project into a knowledge graph that your AI coding assistant can query instead of grepping through files. Code is parsed locally, with no LLM, and you can click through the graph in a browser.

Dash ties UI elements like dropdowns, sliders, and graphs to your Python code, and draws charts with Plotly through dcc.Graph. You add interactivity with callbacks: functions Dash calls whenever an input changes, to update another component.

Gradio builds a demo or web app for an ML model, an API, or any Python function, with no JavaScript or CSS. Start with gr.Interface, which takes your function plus its inputs and outputs. Use gr.ChatInterface for a chatbot, and gr.Blocks when you need your own layout and data flow.

Pick the chart library and the way you share it separately. Plotly, Vega-Altair, and Bokeh all save interactive charts as standalone HTML files: write_html(), chart.save("chart.html"), and output_file(). Streamlit has chart elements for Matplotlib, Vega-Altair, Plotly, and Graphviz, and Gradio's gr.Plot takes Matplotlib, Plotly, Vega-Altair, and Bokeh figures.

Know a project that belongs here?

Tell us what it does and why it stands out.