plotly.py
The interactive graphing library for Python :sparkles:
A Python library for making interactive charts and graphs that run in the browser, hover, zoom, and filter data without writing any JavaScript.
plotly.py is a Python library for creating interactive charts and graphs that run in a web browser. Rather than producing static image files, the charts respond to mouse interactions — you can hover to see values, zoom in, pan, and toggle data series on and off.
The library is built on top of plotly.js and provides a high-level, declarative interface, meaning you describe what you want the chart to look like rather than writing low-level drawing code. It comes with over 30 chart types including scientific plots, 3D graphs, statistical charts, geographic maps, financial charts, and more. Charts can be displayed inside Jupyter notebooks (interactive coding environments), saved as standalone HTML files, or embedded inside Dash applications (a framework for building data dashboards in Python).
Installation is straightforward: pip install plotly. For use as a Jupyter widget, the anywidget package is also needed. For saving charts as static image files (PNG, SVG, etc.) rather than interactive HTML, the kaleido package provides that capability. Extended geographic features like county-level map overlays require a separate plotly-geo package. The library is MIT-licensed and maintained by Plotly, Inc.
Where it fits
- Create an interactive line chart or scatter plot in a Jupyter notebook that lets you hover to see exact values
- Build a standalone HTML file with a 3D surface plot to share with stakeholders who don't code
- Embed an interactive financial candlestick chart inside a Dash web dashboard
- Save a geographic map visualization as a static PNG for a report using the kaleido package