Plotly Express

0.4.1 · active · verified Sat Apr 11

Plotly Express (often imported as `px`) is a high-level Python visualization library, designed as a terse, consistent, and easy-to-learn wrapper for Plotly.py. It simplifies the creation of interactive charts with single-function calls, offering over 30 functions for various plot types, including statistical, scientific, and geographical charts. While `plotly-express` on PyPI is at version 0.4.1, the core functionality is now a built-in module, `plotly.express`, within the main `plotly` library (version 6.x.x+), which is actively developed and maintained.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import `plotly.express`, load a sample dataset, create a basic scatter plot with colored data points based on a category, and display the interactive figure.

import plotly.express as px
import pandas as pd

# Use a built-in dataset for a quick example
df = px.data.iris()

# Create a scatter plot
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species", title="Iris Sepal Width vs Length")

# Display the figure
fig.show()

view raw JSON →