[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-980ad81c-8669-4856-9716-9e66a17c4d0a":3,"$fieYZHJ_j1HnsTSq2ZC9JTZJ5C5JJF4PEBxzLmSFhRCc":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"980ad81c-8669-4856-9716-9e66a17c4d0a","plotly","交互式可视化库。需要悬停信息、缩放、平移或可嵌入网页的图表时使用。最适合仪表盘、探索性分析和演示。静态出版物图表使用matplotlib或科学可视化。","cat_prod_data","mod_productivity","sickn33,productivity","---\nname: plotly\ndescription: Interactive visualization library. Use when you need hover info, zoom, pan, or web-embeddable charts. Best for dashboards, exploratory analysis, and presentations. For static publication figures use matplotlib or scientific-visualization.\nlicense: MIT license\nmetadata:\n    skill-author: K-Dense Inc.\nrisk: unknown\nsource: community\n---\n\n# Plotly\n\nPython graphing library for creating interactive, publication-quality visualizations with 40+ chart types.\n\n## When to Use\n- You need interactive charts with hover, zoom, pan, or web embedding.\n- You are building dashboards, exploratory analysis notebooks, or presentations that benefit from rich interaction.\n- You want to choose between Plotly Express and Graph Objects for the same visualization task.\n\n## Quick Start\n\nInstall Plotly:\n```bash\nuv pip install plotly\n```\n\nBasic usage with Plotly Express (high-level API):\n```python\nimport plotly.express as px\nimport pandas as pd\n\ndf = pd.DataFrame({\n    'x': [1, 2, 3, 4],\n    'y': [10, 11, 12, 13]\n})\n\nfig = px.scatter(df, x='x', y='y', title='My First Plot')\nfig.show()\n```\n\n## Choosing Between APIs\n\n### Use Plotly Express (px)\nFor quick, standard visualizations with sensible defaults:\n- Working with pandas DataFrames\n- Creating common chart types (scatter, line, bar, histogram, etc.)\n- Need automatic color encoding and legends\n- Want minimal code (1-5 lines)\n\nSee reference\u002Fplotly-express.md for complete guide.\n\n### Use Graph Objects (go)\nFor fine-grained control and custom visualizations:\n- Chart types not in Plotly Express (3D mesh, isosurface, complex financial charts)\n- Building complex multi-trace figures from scratch\n- Need precise control over individual components\n- Creating specialized visualizations with custom shapes and annotations\n\nSee reference\u002Fgraph-objects.md for complete guide.\n\n**Note:** Plotly Express returns graph objects Figure, so you can combine approaches:\n```python\nfig = px.scatter(df, x='x', y='y')\nfig.update_layout(title='Custom Title')  # Use go methods on px figure\nfig.add_hline(y=10)                     # Add shapes\n```\n\n## Core Capabilities\n\n### 1. Chart Types\n\nPlotly supports 40+ chart types organized into categories:\n\n**Basic Charts:** scatter, line, bar, pie, area, bubble\n\n**Statistical Charts:** histogram, box plot, violin, distribution, error bars\n\n**Scientific Charts:** heatmap, contour, ternary, image display\n\n**Financial Charts:** candlestick, OHLC, waterfall, funnel, time series\n\n**Maps:** scatter maps, choropleth, density maps (geographic visualization)\n\n**3D Charts:** scatter3d, surface, mesh, cone, volume\n\n**Specialized:** sunburst, treemap, sankey, parallel coordinates, gauge\n\nFor detailed examples and usage of all chart types, see reference\u002Fchart-types.md.\n\n### 2. Layouts and Styling\n\n**Subplots:** Create multi-plot figures with shared axes:\n```python\nfrom plotly.subplots import make_subplots\nimport plotly.graph_objects as go\n\nfig = make_subplots(rows=2, cols=2, subplot_titles=('A', 'B', 'C', 'D'))\nfig.add_trace(go.Scatter(x=[1, 2], y=[3, 4]), row=1, col=1)\n```\n\n**Templates:** Apply coordinated styling:\n```python\nfig = px.scatter(df, x='x', y='y', template='plotly_dark')\n# Built-in: plotly_white, plotly_dark, ggplot2, seaborn, simple_white\n```\n\n**Customization:** Control every aspect of appearance:\n- Colors (discrete sequences, continuous scales)\n- Fonts and text\n- Axes (ranges, ticks, grids)\n- Legends\n- Margins and sizing\n- Annotations and shapes\n\nFor complete layout and styling options, see reference\u002Flayouts-styling.md.\n\n### 3. Interactivity\n\nBuilt-in interactive features:\n- Hover tooltips with customizable data\n- Pan and zoom\n- Legend toggling\n- Box\u002Flasso selection\n- Rangesliders for time series\n- Buttons and dropdowns\n- Animations\n\n```python\n# Custom hover template\nfig.update_traces(\n    hovertemplate='\u003Cb>%{x}\u003C\u002Fb>\u003Cbr>Value: %{y:.2f}\u003Cextra>\u003C\u002Fextra>'\n)\n\n# Add rangeslider\nfig.update_xaxes(rangeslider_visible=True)\n\n# Animations\nfig = px.scatter(df, x='x', y='y', animation_frame='year')\n```\n\nFor complete interactivity guide, see reference\u002Fexport-interactivity.md.\n\n### 4. Export Options\n\n**Interactive HTML:**\n```python\nfig.write_html('chart.html')                       # Full standalone\nfig.write_html('chart.html', include_plotlyjs='cdn')  # Smaller file\n```\n\n**Static Images (requires kaleido):**\n```bash\nuv pip install kaleido\n```\n\n```python\nfig.write_image('chart.png')   # PNG\nfig.write_image('chart.pdf')   # PDF\nfig.write_image('chart.svg')   # SVG\n```\n\nFor complete export options, see reference\u002Fexport-interactivity.md.\n\n## Common Workflows\n\n### Scientific Data Visualization\n\n```python\nimport plotly.express as px\n\n# Scatter plot with trendline\nfig = px.scatter(df, x='temperature', y='yield', trendline='ols')\n\n# Heatmap from matrix\nfig = px.imshow(correlation_matrix, text_auto=True, color_continuous_scale='RdBu')\n\n# 3D surface plot\nimport plotly.graph_objects as go\nfig = go.Figure(data=[go.Surface(z=z_data, x=x_data, y=y_data)])\n```\n\n### Statistical Analysis\n\n```python\n# Distribution comparison\nfig = px.histogram(df, x='values', color='group', marginal='box', nbins=30)\n\n# Box plot with all points\nfig = px.box(df, x='category', y='value', points='all')\n\n# Violin plot\nfig = px.violin(df, x='group', y='measurement', box=True)\n```\n\n### Time Series and Financial\n\n```python\n# Time series with rangeslider\nfig = px.line(df, x='date', y='price')\nfig.update_xaxes(rangeslider_visible=True)\n\n# Candlestick chart\nimport plotly.graph_objects as go\nfig = go.Figure(data=[go.Candlestick(\n    x=df['date'],\n    open=df['open'],\n    high=df['high'],\n    low=df['low'],\n    close=df['close']\n)])\n```\n\n### Multi-Plot Dashboards\n\n```python\nfrom plotly.subplots import make_subplots\nimport plotly.graph_objects as go\n\nfig = make_subplots(\n    rows=2, cols=2,\n    subplot_titles=('Scatter', 'Bar', 'Histogram', 'Box'),\n    specs=[[{'type': 'scatter'}, {'type': 'bar'}],\n           [{'type': 'histogram'}, {'type': 'box'}]]\n)\n\nfig.add_trace(go.Scatter(x=[1, 2, 3], y=[4, 5, 6]), row=1, col=1)\nfig.add_trace(go.Bar(x=['A', 'B'], y=[1, 2]), row=1, col=2)\nfig.add_trace(go.Histogram(x=data), row=2, col=1)\nfig.add_trace(go.Box(y=data), row=2, col=2)\n\nfig.update_layout(height=800, showlegend=False)\n```\n\n## Integration with Dash\n\nFor interactive web applications, use Dash (Plotly's web app framework):\n\n```bash\nuv pip install dash\n```\n\n```python\nimport dash\nfrom dash import dcc, html\nimport plotly.express as px\n\napp = dash.Dash(__name__)\n\nfig = px.scatter(df, x='x', y='y')\n\napp.layout = html.Div([\n    html.H1('Dashboard'),\n    dcc.Graph(figure=fig)\n])\n\napp.run_server(debug=True)\n```\n\n## Reference Files\n\n- **plotly-express.md** - High-level API for quick visualizations\n- **graph-objects.md** - Low-level API for fine-grained control\n- **chart-types.md** - Complete catalog of 40+ chart types with examples\n- **layouts-styling.md** - Subplots, templates, colors, customization\n- **export-interactivity.md** - Export options and interactive features\n\n## Additional Resources\n\n- Official documentation: https:\u002F\u002Fplotly.com\u002Fpython\u002F\n- API reference: https:\u002F\u002Fplotly.com\u002Fpython-api-reference\u002F\n- Community forum: https:\u002F\u002Fcommunity.plotly.com\u002F\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,192,1212,"2026-05-16 13:34:11",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"效率工具","productivity","mdi-lightning-bolt-outline","文档处理、数据分析、自动化工作流",4,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"数据分析","data-analysis","mdi-chart-bar","数据可视化、统计分析",2,30,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"cbc42e1e-f368-4b29-9d08-8c2a2e401fc7","1.0.0","plotly.zip",3222,"uploads\u002Fskills\u002F980ad81c-8669-4856-9716-9e66a17c4d0a\u002Fplotly.zip","4d83d029bebade00f46f8cf47d9ea87a5fd4a7fd1853a77022e48c05b84245db","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":7494}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]