create-viz by anthropics/knowledge-work-plugins
npx skills add https://github.com/anthropics/knowledge-work-plugins --skill create-viz如果您看到不熟悉的占位符或需要检查已连接的工具,请参阅 CONNECTORS.md。
使用 Python 创建出版物质量的数据可视化图表。根据数据生成图表,遵循清晰度、准确性和设计方面的最佳实践。
/create-viz <数据源> [图表类型] [附加说明]
确定:
如果数据仓库已连接且需要查询数据:
如果数据是粘贴或上传的:
如果数据来自对话中的先前分析:
如果用户未指定图表类型,则根据数据和问题推荐一种:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 数据关系 | 推荐图表 |
|---|---|
| 随时间趋势 | 折线图 |
| 跨类别比较 | 条形图(如果类别较多则使用水平条形图) |
| 部分与整体构成 | 堆积条形图或面积图(除非类别少于6个,否则避免饼图) |
| 数值分布 | 直方图或箱线图 |
| 两个变量间的相关性 | 散点图 |
| 两个变量随时间的比较 | 双轴折线图或分组条形图 |
| 地理数据 | 等值区域图 |
| 排名 | 水平条形图 |
| 流程或过程 | 桑基图 |
| 关系矩阵 | 热力图 |
如果用户未指定,请简要解释推荐理由。
根据需求使用以下库之一编写 Python 代码:
代码要求:
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
# 设置专业样式
plt.style.use('seaborn-v0_8-whitegrid')
sns.set_palette("husl")
# 创建具有适当大小的图形
fig, ax = plt.subplots(figsize=(10, 6))
# [图表特定代码]
# 始终包含:
ax.set_title('清晰、描述性的标题', fontsize=14, fontweight='bold')
ax.set_xlabel('X轴标签', fontsize=11)
ax.set_ylabel('Y轴标签', fontsize=11)
# 适当格式化数字
# - 百分比:'45.2%' 而不是 '0.452'
# - 货币:'$1.2M' 而不是 '1200000'
# - 大数字:'2.3K' 或 '1.5M' 而不是 '2300' 或 '1500000'
# 移除图表冗余元素
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
plt.tight_layout()
plt.savefig('chart_name.png', dpi=150, bbox_inches='tight')
plt.show()
颜色:
排版:
布局:
准确性:
/create-viz 显示过去12个月的月度收入作为折线图,并突出显示趋势
/create-viz 这是我们按产品的 NPS 数据:[粘贴数据]。创建一个按分数排名产品的水平条形图。
/create-viz 查询 orders 表并创建一个按星期几和小时显示订单量的热力图
每周安装量
203
代码仓库
GitHub 星标数
10.3K
首次出现
11 天前
安全审计
安装于
gemini-cli193
codex192
cursor192
opencode192
github-copilot191
kimi-cli191
If you see unfamiliar placeholders or need to check which tools are connected, see CONNECTORS.md.
Create publication-quality data visualizations using Python. Generates charts from data with best practices for clarity, accuracy, and design.
/create-viz <data source> [chart type] [additional instructions]
Determine:
If data warehouse is connected and data needs querying:
If data is pasted or uploaded:
If data is from a previous analysis in the conversation:
If the user didn't specify a chart type, recommend one based on the data and question:
| Data Relationship | Recommended Chart |
|---|---|
| Trend over time | Line chart |
| Comparison across categories | Bar chart (horizontal if many categories) |
| Part-to-whole composition | Stacked bar or area chart (avoid pie charts unless <6 categories) |
| Distribution of values | Histogram or box plot |
| Correlation between two variables | Scatter plot |
| Two-variable comparison over time | Dual-axis line or grouped bar |
| Geographic data | Choropleth map |
| Ranking | Horizontal bar chart |
| Flow or process | Sankey diagram |
| Matrix of relationships | Heatmap |
Explain the recommendation briefly if the user didn't specify.
Write Python code using one of these libraries based on the need:
Code requirements:
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
# Set professional style
plt.style.use('seaborn-v0_8-whitegrid')
sns.set_palette("husl")
# Create figure with appropriate size
fig, ax = plt.subplots(figsize=(10, 6))
# [chart-specific code]
# Always include:
ax.set_title('Clear, Descriptive Title', fontsize=14, fontweight='bold')
ax.set_xlabel('X-Axis Label', fontsize=11)
ax.set_ylabel('Y-Axis Label', fontsize=11)
# Format numbers appropriately
# - Percentages: '45.2%' not '0.452'
# - Currency: '$1.2M' not '1200000'
# - Large numbers: '2.3K' or '1.5M' not '2300' or '1500000'
# Remove chart junk
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
plt.tight_layout()
plt.savefig('chart_name.png', dpi=150, bbox_inches='tight')
plt.show()
Color:
Typography:
Layout:
Accuracy:
/create-viz Show monthly revenue for the last 12 months as a line chart with the trend highlighted
/create-viz Here's our NPS data by product: [pastes data]. Create a horizontal bar chart ranking products by score.
/create-viz Query the orders table and create a heatmap of order volume by day-of-week and hour
Weekly Installs
203
Repository
GitHub Stars
10.3K
First Seen
11 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli193
codex192
cursor192
opencode192
github-copilot191
kimi-cli191
DOCX文件创建、编辑与分析完整指南 - 使用docx-js、Pandoc和Python脚本
51,800 周安装