跳到正文
cccskills
免费在 GitHub 公开

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. R equivalent: plotly-r (use when execution language is R).

中文简介正在准备中。当前显示原文说明。

DAAF-Contribution-Community/daaf星标 238(GitHub 238 + cccskills 0)

实测评分 未实测

查看安装方法

包含的文件(7)

  • SKILL.md8.0 KB
  • references/charts.md6.9 KB
  • references/export.md5.8 KB
  • references/gotchas.md6.9 KB
  • references/quickstart.md5.3 KB
  • references/styling.md7.5 KB
  • references/subplots-facets.md6.1 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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

FilePurposeWhen to Read
quickstart.mdInstallation, imports, px vs goStarting out
charts.mdScatter, line, bar, histogram, boxCreating visualizations
subplots-facets.mdMulti-panel layouts, facetingMultiple charts together
styling.mdTemplates, colors, layoutCustomizing appearance
export.mdHTML, images, JSONSaving and sharing
gotchas.mdCommon errors, best practicesDebugging

The reference-file routing in this skill applies to advisory and brainstorming turns as much as implementation. Recommending an approach, reviewing a plan, or answering a question that touches a routed topic calls for reading the routed reference file just as much as writing code does — the reference files carry curated caveats and environment-specific constraints that this overview and general knowledge lack.

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

FunctionChart 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

TraceUse Case
go.ScatterPoints, lines, or both
go.BarBar charts
go.HistogramHistograms
go.BoxBox plots
go.HeatmapHeatmaps
go.PiePie 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.write_image("plot.png")  # Would require: pip install kaleido + Chromium

Topic Index

TopicReference 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

Citation

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.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Guide for creating DAAF agent definition files. Covers 12-section template, hook registration, skills-in-frontmatter, integration checklist. Use when adding or revising agents. For SKILL.md files, use skill-authoring instead.

中文简介正在准备中。当前显示原文说明。

DAAF-Contribution-Community/daaf2382026年10月17日 更新

Researcher-facing analytic triangulation ("creative verification") for stress-testing provisional findings and designing pre-specified challenges before an analysis runs. Turns a researcher's concern or focal claim into competing explanations, bounded discriminating tests, audited diagnostic artifacts, and evidence-calibrated interpretations in a hypothesis/evidence ledger — behavioral, output-level verification replacing line-by-line code review. Covers 12 challenge families organized by Shadish-Cook-Campbell validity type, named sensitivity statistics, pre-committed interpretation rules, anti-fishing guardrails, and interactive diagnostic-artifact QA. Use in Ad Hoc Collaboration to verify, challenge, or stress-test a result, or to design discriminating tests before an analysis runs. Not code-change verification (verify skill / code review) and not final adjudication or re-execution (data-verifier, Reproducibility Verification) — prospective, hypothesis-driven challenge design of analytic claims.

中文简介正在准备中。当前显示原文说明。

DAAF-Contribution-Community/daaf2382026年10月17日 更新

In-situ smoke testing that verifies a LIVE DAAF deployment functions end-to-end in whatever provider route it is configured for. Auto-detects the active install route (anthropic-subscription, openrouter, chatgpt-subscription shim, openai-api shim) and runs tiered probes: Tier 0 free preflight (route/env coherence, hooks, statuslines, shim health); Tier 1 one live round-trip (~cents); Tier 2 a six-probe functional battery (dispatch, coding, web, skill loading, isolation-strip, nested-dispatch deny); Tier D a zero-cost deterministic battery (bats, Pester, lint, safety-hook tests). Use after install, after a rebuild or update, after any provider/config change (new API key, model remap, shim change), for pre-release validation, or when asked "is my install working" or to "smoke test the deployment/config." Requires the DAAF_DEV=1 dev image; a contributor tool, not end-user-facing. NOT DAAFBench (model behavioral-adherence evaluation under benchmarks/) and NOT scripts/smoke_tests/ (R/Python library-package smoke tests).

中文简介正在准备中。当前显示原文说明。

DAAF-Contribution-Community/daaf2382026年10月17日 更新

Operational framework for the DAAF orchestrator. Defines engagement modes, confirmation protocol, subagent dispatch, context budget, and reference-loading. Loaded exclusively by the orchestrator — not for subagents or user questions.

中文简介正在准备中。当前显示原文说明。

DAAF-Contribution-Community/daaf2382026年10月17日 更新

Data science methodology and method-selection routing for quantitative research. Covers EDA, data validation, descriptive analysis, causal inference (IV, DiD, RD, synthetic control), clustering/PCA/UMAP, supervised ML, geospatial analysis, network analysis, and visualization design. Contains the canonical method-to-library routing tree, routed by execution language — Python: statsmodels (OLS/GLM/time series), pyfixest (FE/DiD), linearmodels (RE/GMM/SUR), svy (complex surveys), scikit-learn (clustering/prediction ML), geopandas (spatial), igraph (network analysis); R: r-stats (OLS/GLM/time series), fixest (FE/DiD), plm (panel/RE/IV), survey-r (complex surveys), tidymodels (ML), sf-terra (spatial), igraph-r (network analysis). Load the routed tool-specific skill before giving tool-specific advice or writing code — library skills encode environment constraints and curated caveats absent from general knowledge.

中文简介正在准备中。当前显示原文说明。

DAAF-Contribution-Community/daaf2382026年10月17日 更新

Interpretation guidance for Urban Institute Education Data Portal datasets. The Portal is a curation layer over federal data: lowercase variable names, integer-encoded categoricals, standardized missing codes (-1 missing, -2 not applicable, -3 suppressed). Covers year definitions, grade encoding (grade=-1 is Pre-K, not missing), suppression rates, ODC-By licensing, and cross-source join identifiers. Load before analyzing any Portal data. Routes to source-specific deep-dive skills for individual datasets.

中文简介正在准备中。当前显示原文说明。

DAAF-Contribution-Community/daaf2382026年10月17日 更新

查看 DAAF-Contribution-Community 的全部技能

报告此技能的问题