資料視覺化通常需要複雜的程式碼且缺乏探索互動性。本技能提供使用 Plotly 建立互動式、出版品質圖表的全面指導,具備滑鼠懸停提示、縮放、平移功能,以及超過 40 種圖表類型,適用於儀表板和資料分析。
下載技能 ZIP
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
開啟並開始使用
測試它
正在使用「plotly」。 Create a simple scatter plot of x and y data
預期結果:
顯示 px.scatter() 基本參數的程式碼片段、用於顯示的 fig.show(),以及互動功能(如縮放和懸停)的說明
正在使用「plotly」。 How do I export my Plotly chart to HTML?
預期結果:
使用 fig.write_html() 的程式碼範例,包含檔案路徑參數說明,以及 JavaScript 函式庫的嵌入式與 CDN 選項
正在使用「plotly」。 Build a 3D surface plot
預期結果:
使用 go.Surface() 處理網格資料的程式碼、相機角度設定,以及色階自訂指示
安全審計
安全This is a legitimate documentation skill for the Plotly visualization library. All 342 static findings are false positives from the pattern scanner detecting markdown code block delimiters as shell commands, documentation text as malicious keywords, and legitimate API references as threats. No actual security risks present.
品質評分
你能建構什麼
儀表板開發
建立商業智慧互動式儀表板,具備即時資料探索功能,包括篩選、縮放和懸停詳細資訊。
科學資料視覺化
為研究論文、簡報和報告建立出版品質的圖表,精確控制樣式和版面配置。
探索性資料分析
使用互動式圖表快速視覺化資料分布、相關性和模式,用於假設生成和資料品質評估。
試試這些提示
Create a scatter plot showing the relationship between temperature and sales using Plotly Express
Generate an interactive line chart comparing monthly revenue across three product categories with hover tooltips
Build a histogram with custom colors, bin sizes, and annotations showing data distribution with mean and median lines
Create a dashboard with subplots containing a scatter plot, bar chart, and heatmap arranged in a grid layout with shared color scales
最佳實務
- 使用 Plotly Express 快速建立標準視覺化圖表,使用 Graph Objects 精確控制複雜的自訂圖表
- 使用 fig.update_layout 啟用響應式調整大小,讓圖表適應不同螢幕尺寸和容器尺寸
- 透過在視覺化之前彙總資料或使用取樣技術來最佳化大型資料集,以維持互動效能
避免
- 當 Plotly Express 能以更少程式碼達成相同結果時,避免使用 Graph Objects 建立簡單圖表
- 不要建立具有過多軌跡或資料點的過度複雜圖表,這會使互動變慢或令人困惑
- 不要在未考慮不同顯示環境的響應式設計情況下,硬編碼圖表尺寸