/plotly
Plotly interactive visualization. Express and Graph Objects: scatter, line, bar, heatmap, 3D, geographic charts; subplots; styling; export. Use when interactivity (hover/zoom) is needed. For static figures use plotnine; for GIS use geopandas.
$ npx -y skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill plotly --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/plotly
Context preview
The summary Claude sees to decide when to auto-load this skill.
Plotly interactive visualization. Express and Graph Objects: scatter, line, bar, heatmap, 3D, geographic charts; subplots; styling; export. Use when interactivity (hover/zoom) is needed. For static figures use plotnine; for GIS use geopandas.
SKILL.md
plotly.SKILL.mdname: plotly
description: >-
Plotly interactive visualization. Express and Graph Objects: scatter, line, bar, heatmap, 3D, geographic charts; subplots; styling; export. Use when interactivity (hover/zoom) is needed. For static figures use plotnine; for GIS use geopandas.
metadata:
audience: research-coders
domain: python-library
library-version: "6.x"
skill-last-updated: "2026-03-28"
Plotly Skill
Plotly interactive visualization library for Python. Covers Plotly Express and Graph Objects for scatter, line, bar, histogram, box, heatmap, 3D, and geographic charts; subplots and faceting; styling; and HTML/image export. Use when creating interactive visualizations with hover/zoom/pan, building web-based charts, or producing geographic or 3D plots. Prefer over plotnine when interactivity is required; for spatial analysis, projections, or GIS-style mapping, use geopandas.
Quick reference for creating interactive data visualizations with Plotly, featuring both the high-level Plotly Express API and low-level Graph Objects.
What is Plotly?
Plotly is an interactive visualization library for Python:
- **Interactive**: Hover, zoom, pan, and select built-in
- **Two APIs**: Plotly Express (simple) and Graph Objects (flexible)
- **Web-based**: Renders as HTML/JavaScript, works in notebooks and browsers
- **Wide chart support**: 40+ chart types including statistical, scientific, financial, and geographic
How to Use This Skill
Reference File Structure
| File | Purpose | When to Read | |------|---------|--------------| | `quickstart.md` | Installation, imports, px vs go | Starting out | | `charts.md` | Scatter, line, bar, histogram, box | Creating visualizations | | `subplots-facets.md` | Multi-panel layouts, faceting | Multiple charts together | | `styling.md` | Templates, colors, layout | Customizing appearance | | `export.md` | HTML, images, JSON | Saving and sharing | | `gotchas.md` | Common errors, best practices | Debugging |
Quick Decision Trees
"I need to create a chart"
What kind of chart?
├─ Scatter plot → ./references/charts.md
├─ Line chart → ./references/charts.md
├─ Bar chart → ./references/charts.md
├─ Histogram → ./references/charts.md
├─ Box/Violin plot → ./references/charts.md
├─ Heatmap → ./references/charts.md
├─ 3D/Maps/Financial → ./references/charts.md (Other Chart Types)
└─ Not sure → ./references/quickstart.md
"I need multiple charts"
Multiple panels?
├─ Same chart, split by category → ./references/subplots-facets.md (faceting)
├─ Different charts in grid → ./references/subplots-facets.md (make_subplots)
├─ Shared axes → ./references/subplots-facets.md
└─ Secondary y-axis → ./references/subplots-facets.md
"I need to customize appearance"
What to customize?
├─ Overall theme → ./references/styling.md (templates)
├─ Colors → ./references/styling.md
├─ Titles/labels → ./references/styling.md
├─ Axes → ./references/styling.md
├─ Legend → ./references/styling.md
└─ Hover info → ./references/styling.md
"I need to save/export"
Export format?
├─ Interactive HTML → ./references/export.md
├─ Static image (PNG/SVG/PDF) → ./references/export.md
├─ JSON for API → ./references/export.md
└─ Embed in webpage → ./references/export.md
"Something isn't working"
Common issues?
├─ Figure not showing → ./references/gotchas.md
├─ Image export fails → ./references/gotchas.md
├─ Performance issues → ./references/gotchas.md
├─ px vs go confusion → ./references/gotchas.md
└─ Column/data errors → ./references/gotchas.md
File-First Execution in Research Workflows
**Important:** In data research pipelines (see `CLAUDE.md`), all visualizations are generated through **script files** in `scripts/stage8_analysis/`, not interactively. This ensures auditability and reproducibility.
**The pattern:** 1. Write plot code FIRST to `scripts/stage8_analysis/{step}_{plot-name}.py` 2. Execute via Bash with automatic output capture wrapper script 3. Validation results get automatically embedded in scripts as comments 4. If failed, create versioned copy for fixes
Closely read `agent_reference/SCRIPT_EXECUTION_REFERENCE.md` for the mandatory file-first execution protocol covering complete code file writing, output capture, and file versioning rules.
**See:**
- `agent_reference/WORKFLOW_PHASE4_ANALYSIS.md` — Stage 8 (Analysis & Visualization)
The examples below show Plotly syntax. In research workflows, wrap them in scripts following the file-first pattern.
---
Quick Reference
Essential Imports
import plotly.express as px # High-level API
import plotly.graph_objects as go # Low-level API
from plotly.subplots import make_subplots # For subplots
import plotly.io as pio # For export/config
Plotly Express Pattern
import plotly.express as px
fig = px.scatter(df, x="col_x", y="col_y", color="category")
fig.show()
Graph Objects Pattern
import plotly.graph_objects as go
fig = go.Figure()
fig.add_trace(go.Scatter(x=x_data, y=y_data, mode="markers"))
fig.update_layout(title="My Plot")
fig.show()
Common px Functions
| Function | Chart Type | |----------|------------| | `px.scatter()` | Scatter plot | | `px.line()` | Line chart | | `px.bar()` | Bar chart | | `px.histogram()` | Histogram | | `px.box()` | Box plot | | `px.violin()` | Violin plot | | `px.imshow()` | Heatmap/Image | | `px.pie()` | Pie chart |
Common go Trace Types
| Trace | Use Case | |-------|----------| | `go.Scatter` | Points, lines, or both | | `go.Bar` | Bar charts | | `go.Histogram` | Histograms | | `go.Box` | Box plots | | `go.Heatmap` | Heatmaps | | `go.Pie` | Pie charts |
Saving Plots
# Interactive HTML
fig.write_html("plot.html")
# Static image export (PNG/SVG/PDF) is NOT available in DAAF — kaleido is not
# installed due to its heavy Chromium dependency. Use plotnine for static figures.
# For interactive output, use HTML:
# fig.wRead more
name: plotly description: >- Plotly interactive visualization. Express and Graph Objects: scatter, line, bar, heatmap, 3D, geographic charts; subplots; styling; export. Use when interactivity (hover/zoom) is needed. For static figures use plotnine; for GIS use geopandas. metadata: audience: research-coders domain: python-library library-version: "6.x" skill-last-updated: "2026-03-28"
Plotly Skill
Plotly interactive visualization library for Python. Covers Plotly Express and Graph Objects for scatter, line, bar, histogram, box, heatmap, 3D, and geographic charts; subplots and faceting; styling; and HTML/image export. Use when creating interactive visualizations with hover/zoom/pan, building web-based charts, or producing geographic or 3D plots. Prefer over plotnine when interactivity is required; for spatial analysis, projections, or GIS-style mapping, use geopandas.
Quick reference for creating interactive data visualizations with Plotly, featuring both the high-level Plotly Express API and low-level Graph Objects.
What is Plotly?
Plotly is an interactive visualization library for Python:
- **Interactive**: Hover, zoom, pan, and select built-in
- **Two APIs**: Plotly Express (simple) and Graph Objects (flexible)
- **Web-based**: Renders as HTML/JavaScript, works in notebooks and browsers
- **Wide chart support**: 40+ chart types including statistical, scientific, financial, and geographic
How to Use This Skill
Reference File Structure
| File | Purpose | When to Read | |------|---------|--------------| | `quickstart.md` | Installation, imports, px vs go | Starting out | | `charts.md` | Scatter, line, bar, histogram, box | Creating visualizations | | `subplots-facets.md` | Multi-panel layouts, faceting | Multiple charts together | | `styling.md` | Templates, colors, layout | Customizing appearance | | `export.md` | HTML, images, JSON | Saving and sharing | | `gotchas.md` | Common errors, best practices | Debugging |
Quick Decision Trees
"I need to create a chart"
What kind of chart? ├─ Scatter plot → ./references/charts.md ├─ Line chart → ./references/charts.md ├─ Bar chart → ./references/charts.md ├─ Histogram → ./references/charts.md ├─ Box/Violin plot → ./references/charts.md ├─ Heatmap → ./references/charts.md ├─ 3D/Maps/Financial → ./references/charts.md (Other Chart Types) └─ Not sure → ./references/quickstart.md
"I need multiple charts"
Multiple panels? ├─ Same chart, split by category → ./references/subplots-facets.md (faceting) ├─ Different charts in grid → ./references/subplots-facets.md (make_subplots) ├─ Shared axes → ./references/subplots-facets.md └─ Secondary y-axis → ./references/subplots-facets.md
"I need to customize appearance"
What to customize? ├─ Overall theme → ./references/styling.md (templates) ├─ Colors → ./references/styling.md ├─ Titles/labels → ./references/styling.md ├─ Axes → ./references/styling.md ├─ Legend → ./references/styling.md └─ Hover info → ./references/styling.md
"I need to save/export"
Export format? ├─ Interactive HTML → ./references/export.md ├─ Static image (PNG/SVG/PDF) → ./references/export.md ├─ JSON for API → ./references/export.md └─ Embed in webpage → ./references/export.md
"Something isn't working"
Common issues? ├─ Figure not showing → ./references/gotchas.md ├─ Image export fails → ./references/gotchas.md ├─ Performance issues → ./references/gotchas.md ├─ px vs go confusion → ./references/gotchas.md └─ Column/data errors → ./references/gotchas.md
File-First Execution in Research Workflows
**Important:** In data research pipelines (see `CLAUDE.md`), all visualizations are generated through **script files** in `scripts/stage8_analysis/`, not interactively. This ensures auditability and reproducibility.
**The pattern:** 1. Write plot code FIRST to `scripts/stage8_analysis/{step}_{plot-name}.py` 2. Execute via Bash with automatic output capture wrapper script 3. Validation results get automatically embedded in scripts as comments 4. If failed, create versioned copy for fixes
Closely read `agent_reference/SCRIPT_EXECUTION_REFERENCE.md` for the mandatory file-first execution protocol covering complete code file writing, output capture, and file versioning rules.
**See:**
- `agent_reference/WORKFLOW_PHASE4_ANALYSIS.md` — Stage 8 (Analysis & Visualization)
The examples below show Plotly syntax. In research workflows, wrap them in scripts following the file-first pattern.
---
Quick Reference
Essential Imports
import plotly.express as px # High-level API import plotly.graph_objects as go # Low-level API from plotly.subplots import make_subplots # For subplots import plotly.io as pio # For export/config
Plotly Express Pattern
import plotly.express as px fig = px.scatter(df, x="col_x", y="col_y", color="category") fig.show()
Graph Objects Pattern
import plotly.graph_objects as go fig = go.Figure() fig.add_trace(go.Scatter(x=x_data, y=y_data, mode="markers")) fig.update_layout(title="My Plot") fig.show()
Common px Functions
| Function | Chart Type | |----------|------------| | `px.scatter()` | Scatter plot | | `px.line()` | Line chart | | `px.bar()` | Bar chart | | `px.histogram()` | Histogram | | `px.box()` | Box plot | | `px.violin()` | Violin plot | | `px.imshow()` | Heatmap/Image | | `px.pie()` | Pie chart |
Common go Trace Types
| Trace | Use Case | |-------|----------| | `go.Scatter` | Points, lines, or both | | `go.Bar` | Bar charts | | `go.Histogram` | Histograms | | `go.Box` | Box plots | | `go.Heatmap` | Heatmaps | | `go.Pie` | Pie charts |
Saving Plots
# Interactive HTML
fig.write_html("plot.html")
# Static image export (PNG/SVG/PDF) is NOT available in DAAF — kaleido is not
# installed due to its heavy Chromium dependency. Use plotnine for static figures.
# For interactive output, use HTML:
# fig.w📌 文档结构(2026-07-22 起): 本文件是中文默认入口 —— banner + badges + 信任面 + 9 阶段流水线速览 + 76 行合集总表。 每个合集的完整描述、按用途分组、精确数字、验证方法在 docs/CONTENT_ZH.md(扩展正文,总表行内的 → 直接跳转到对应锚点)。 English version: README-en.md · 中文扩展正文:docs/CONTENT_ZH.md · README-zh-CN.md 已弃用(重定向占位) 🌐 语言: English |
Other skills on auto-empirical-research-skills.
- /pipeline
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy + statsmodels + linearmodels + pyfixest + rdrobust + econml + causalml + matplotlib/seaborn. **Defaults to economics empirical-paper style** (AER / QJE / AEJ) —
Open skill - /pipeline
Classical end-to-end empirical analysis workflow in the modern tidyverse + econometrics R ecosystem — dplyr + tidyr + haven + fixest + sandwich + lmtest + clubSandwich + AER + ivreg + did + bacondecomp + HonestDiD + eventstudyr + rdrobust + rddensity + Synth + gsynth + synthdid
Open skill - /pipeline
Classical end-to-end empirical analysis workflow in the traditional Stata ecosystem — native Stata + reghdfe + ivreg2 + csdid + did_imputation + eventstudyinteract + sdid + rdrobust + rddensity + synth + synth_runner + psmatch2 + teffects + ebalance + coefplot + esttab + asdoc +
Open skill - /00-Full-empirical-analysis-skill_StatsPAI
Use when the user asks to run a full empirical / causal analysis in Python — by default in the style of an applied economics paper (AER / QJE / JPE / ReStud / AEJ) with DID / RD / IV / SCM / DML / matching, written-out estimating equation + identifying assumption, Table 1 /
Open skill - /00.1-Full-empirical-analysis-skill_Python
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy + statsmodels + linearmodels + pyfixest + rdrobust + econml + causalml + matplotlib/seaborn. **Defaults to economics empirical-paper style** (AER / QJE / AEJ) —
Open skill - /00.2-Full-empirical-analysis-skill_Stata
Classical end-to-end empirical analysis workflow in the traditional Stata ecosystem — native Stata + reghdfe + ivreg2 + csdid + did_imputation + eventstudyinteract + sdid + rdrobust + rddensity + synth + synth_runner + psmatch2 + teffects + ebalance + coefplot + esttab + asdoc +
Open skill

