skills/17-DAAF-Contribution-Community-daaf/dot-claude/skills/plotly/SKILL.md
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 skillsauth add brycewang-stanford/Awesome-Agent-Skills-for-Empirical-Research plotlyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
Plotly is an interactive visualization library for Python:
| 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 |
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
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
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
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
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
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:
scripts/stage8_analysis/{step}_{plot-name}.pyClosely 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.
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
import plotly.express as px
fig = px.scatter(df, x="col_x", y="col_y", color="category")
fig.show()
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()
| 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 |
| 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 |
# 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.write_image("plot.png") # Would require: pip install kaleido + Chromium
| Topic | Reference File |
|-------|---------------|
| Installation | ./references/quickstart.md |
| px vs go | ./references/quickstart.md |
| Built-in datasets | ./references/quickstart.md |
| Scatter plots | ./references/charts.md |
| Line charts | ./references/charts.md |
| Bar charts | ./references/charts.md |
| Histograms | ./references/charts.md |
| Box plots | ./references/charts.md |
| Other chart types | ./references/charts.md |
| Faceting | ./references/subplots-facets.md |
| make_subplots | ./references/subplots-facets.md |
| Templates/Themes | ./references/styling.md |
| Colors | ./references/styling.md |
| Layout customization | ./references/styling.md |
| Hover customization | ./references/styling.md |
| HTML export | ./references/export.md |
| Image export | ./references/export.md |
| JSON export | ./references/export.md |
| Common errors | ./references/gotchas.md |
| Performance | ./references/gotchas.md |
| Best practices | ./references/gotchas.md |
When this library is used as a primary analytical tool, include in the report's Software & Tools references:
Plotly Technologies Inc. Plotly: Interactive graphing library [Computer software]. https://plotly.com/
Cite when: Plotly is the primary visualization library producing interactive figures included in the report or notebook. Do not cite when: Only used for quick exploratory plots not included in deliverables.
development
Conduct rigorous thematic analysis (TA) of qualitative data following Braun and Clarke's (2006) six-phase framework. Use whenever the user mentions 'thematic analysis', 'TA', 'Braun and Clarke', 'qualitative coding', 'identifying themes', or asks for help analysing interviews, focus groups, open-ended survey responses, or transcripts to identify patterns. Also trigger for questions about inductive vs theoretical coding, semantic vs latent themes, essentialist vs constructionist epistemology, building a thematic map, or writing up a qualitative findings section. Covers all six phases, the four upfront analytic decisions, the 15-point quality checklist, and the five common pitfalls. Produces a Word document write-up and an annotated thematic map. Does NOT cover IPA, grounded theory, discourse analysis, conversation analysis, or narrative analysis — use a different method for those.
development
Guide users through writing a systematic literature review (SLR) following the PRISMA 2020 framework. Use this skill whenever the user mentions 'systematic review', 'systematic literature review', 'SLR', 'PRISMA', 'PRISMA 2020', 'PRISMA flow diagram', 'PRISMA checklist', or asks for help writing, structuring, or auditing a literature review that follows reporting guidelines. Also trigger when the user asks about inclusion/exclusion criteria for a review, search strategies for databases like Scopus/WoS/PubMed, study selection processes, risk of bias assessment, or narrative synthesis for a review paper. This skill covers the full PRISMA 2020 checklist (27 items), produces a Word document manuscript in strict journal article format, generates an annotated PRISMA flow diagram, and enforces APA 7th Edition referencing throughout. It does NOT cover meta-analysis or statistical pooling. By Chuah Kee Man.
testing
Performs placebo-in-time sensitivity analysis with hierarchical null model and optional Bayesian assurance. Use when checking model robustness, verifying lack of pre-intervention effects, or estimating study power.
data-ai
Fit, summarize, plot, and interpret a chosen CausalPy experiment. Use after the causal method has been selected, including when configuring PyMC/sklearn models and scale-aware custom priors.