Generate Interactive Data Visualizations with Plotly
A Plotly Python skill for interactive charts with 40+ types, covering Plotly Express, Graph Objects, and Dash integration.
Why it matters
Create dynamic, publication-quality charts and dashboards using Python. This asset leverages Plotly's high-level (Plotly Express) and low-level (Graph Objects) APIs to generate over 40 chart types, enabling interactive exploration and presentation of data.
Outcomes
What it gets done
Generate scatter, line, bar, histogram, and other basic charts.
Create complex statistical, scientific, financial, and 3D visualizations.
Build interactive dashboards with subplots, custom layouts, and animations.
Export visualizations as interactive HTML or static image files (PNG, PDF, SVG).
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-plotly | bash Overview
Plotly
A Plotly Python skill for 40+ interactive chart types, covering the Plotly Express and Graph Objects APIs, subplots, styling, interactivity, export, and Dash integration. Use when a visualization needs interactivity (hover, zoom, pan, web embedding) such as dashboards or exploratory notebooks; choose Express for quick charts and Graph Objects for fine-grained control.
What it does
This skill builds interactive, publication-quality visualizations with Plotly's Python library, covering 40+ chart types across basic charts (scatter, line, bar, pie, area, bubble), statistical charts (histogram, box, violin, distribution, error bars), scientific charts (heatmap, contour, ternary, image display), financial charts (candlestick, OHLC, waterfall, funnel, time series), maps (scatter, choropleth, density), 3D charts (scatter3d, surface, mesh, cone, volume), and specialized charts (sunburst, treemap, sankey, parallel coordinates, gauge). It chooses between Plotly's two APIs: Plotly Express (px) for quick, sensible-default visualizations from pandas DataFrames in 1-5 lines of code with automatic color encoding and legends, and Graph Objects (go) for chart types Express doesn't cover (3D mesh, isosurface, complex financial charts), building complex multi-trace figures from scratch, or needing precise control over individual components - since Express returns a go.Figure, the two can be combined, calling go methods like update_layout() or add_hline() directly on a px-built figure. Layout and styling covers multi-plot subplots with make_subplots, built-in templates (plotly_white, plotly_dark, ggplot2, seaborn, simple_white), and full control over colors, fonts, axes, legends, margins, and annotations. Built-in interactivity includes hover tooltips (customizable via hovertemplate), pan/zoom, legend toggling, box/lasso selection, time-series rangesliders, buttons/dropdowns, and animations (animation_frame). Export options cover standalone or CDN-linked interactive HTML (fig.write_html()) and static PNG/PDF/SVG images via the optional kaleido package (fig.write_image()). For building interactive web applications around these figures, it integrates with Dash, Plotly's own web app framework, embedding a figure in a dcc.Graph component inside a Dash app layout.
When to use - and when NOT to
Use this when a visualization needs interactivity - hover, zoom, pan, or web embedding - such as dashboards, exploratory analysis notebooks, or presentations that benefit from rich interaction, and when deciding between Plotly Express and Graph Objects for the same chart.
As with the skill's own stated limitations, use it only when the task matches this scope, and treat output as guidance rather than a substitute for environment-specific validation or expert review.
Inputs and outputs
Input is data (typically a pandas DataFrame) and a target chart type or dashboard layout. Output is a Plotly Figure object - rendered interactively via fig.show(), embedded in a Dash app, or exported to standalone HTML or a static image format. Common workflows shown include a scatter plot with an OLS trendline, a correlation-matrix heatmap, a 3D surface plot, distribution comparisons (histogram with marginal box plot, box plot with all points shown, violin plot), a rangeslider-enabled time series, a candlestick chart, and a 2x2 subplot dashboard combining scatter/bar/histogram/box charts.
Integrations
Built on plotly.express and plotly.graph_objects, plotly.subplots.make_subplots for multi-plot layouts, the optional kaleido package for static image export, and Dash for turning figures into interactive web applications. Five bundled reference files cover the Express API, the Graph Objects API, the full chart-type catalog, layout/styling options, and export/interactivity in more depth.
Who it's for
Data analysts and developers building interactive dashboards, exploratory notebooks, or presentation-quality charts in Python who need to choose between Plotly's high-level and low-level APIs.
import plotly.express as px
import pandas as pd
df = pd.DataFrame({
'x': [1, 2, 3, 4],
'y': [10, 11, 12, 13]
})
fig = px.scatter(df, x='x', y='y', title='My First Plot')
fig.show()
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.