$ loading_
帮助你用 Python 制作清晰专业的数据可视化并选择合适图表。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "data-visualization" 技能: 1. 下载 https://raw.githubusercontent.com/anthropics/knowledge-work-plugins/main/data/skills/data-visualization/SKILL.md 2. 保存为 ~/.claude/skills/data-visualization/SKILL.md 3. 装好后重载技能,告诉我可以用了
我有一份包含月份、地区、销售额和利润率的表格,请先判断每个字段适合展示的图表类型,再用 Python 分别用 matplotlib、seaborn 或 plotly 生成 3 个清晰的可视化方案,并说明为什么这样选。
给出图表选型建议、对应 Python 代码,以及每种图表的使用理由。
请把下面的实验结果画成适合论文发表的图表,要求字体统一、配色克制、坐标轴和图例规范,并输出可直接运行的 matplotlib 代码。如果有必要,请加入误差线和子图排版建议。
返回高质量科研图表代码,并附带版式与标注优化建议。
我现有一张分类数据图表,但颜色区分不明显。请基于可访问性和色彩理论,重新设计一套适合色觉缺陷用户的配色方案,并用 seaborn 或 plotly 重写示例代码。
提供更易读的配色方案、改进后的代码,以及可访问性设计说明。
Chart selection guidance, Python visualization code patterns, design principles, and accessibility considerations for creating effective data visualizations.
| What You're Showing | Best Chart | Alternatives |
|---|---|---|
| Trend over time | Line chart | Area chart (if showing cumulative or composition) |
| Comparison across categories | Vertical bar chart | Horizontal bar (many categories), lollipop chart |
| Ranking | Horizontal bar chart | Dot plot, slope chart (comparing two periods) |
| Part-to-whole composition | Stacked bar chart | Treemap (hierarchical), waffle chart |
| Composition over time | Stacked area chart | 100% stacked bar (for proportion focus) |
| Distribution | Histogram | Box plot (comparing groups), violin plot, strip plot |
| Correlation (2 variables) | Scatter plot | Bubble chart (add 3rd variable as size) |
| Correlation (many variables) | Heatmap (correlation matrix) | Pair plot |
| Geographic patterns | Choropleth map | Bubble map, hex map |
| Flow / process | Sankey diagram | Funnel chart (sequential stages) |
| Relationship network | Network graph | Chord diagram |
| Performance vs. target | Bullet chart | Gauge (single KPI only) |
| Multiple KPIs at once | Small multiples | Dashboard with separate charts |
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import seaborn as sns
import pandas as pd
import numpy as np
# Professional style setup
plt.style.use('seaborn-v0_8-whitegrid')
plt.rcParams.update({
'figure.figsize': (10, 6),
'figure.dpi': 150,
'font.size': 11,
'axes.titlesize': 14,
'axes.titleweight': 'bold',
'axes.labelsize': 11,
'xtick.labelsize': 10,
'ytick.labelsize': 10,
'legend.fontsize': 10,
'figure.titlesize': 16,
})
# Colorblind-friendly palettes
PALETTE_CATEGORICAL = ['#4C72B0', '#DD8452', '#55A868', '#C44E52', '#8172B3', '#937860']
PALETTE_SEQUENTIAL = 'YlOrRd'
PALETTE_DIVERGING = 'RdBu_r'
fig, ax = plt.subplots(figsize=(10, 6))
for label, group in df.groupby('category'):
ax.plot(group['date'], group['value'], label=label, linewidth=2)
ax.set_title('Metric Trend by Category', fontweight='bold')
ax.set_xlabel('Date')
ax.set_ylabel('Value')
ax.legend(loc='upper left', frameon=True)
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
# Format dates on x-axis
fig.autofmt_xdate()
plt.tight_layout()
plt.savefig('trend_chart.png', dpi=150, bbox_inches='tight')
fig, ax = plt.subplots(figsize=(10, 6))
# Sort by value for easy reading
df_sorted = df.sort_values('metric', ascending=True)
bars = ax.barh(df_sorted['category'], df_sorted['metric'], color=PALETTE_CATEGORICAL[0])
# Add value labels
for bar in bars:
width = bar.get_width()
ax.text(width + 0.5, bar.get_y() + bar.get_height()/2,
f'{width:,.0f}', ha='left', va='center', fontsize=10)
ax.set_title('Metric by Category (Ranked)', fontweight='bold')
ax.set_xlabel('Metric Value')
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
plt.tight_layout()
…
为特定组织定制 Claude Code 插件配置、连接器与工作流适配方案。
围绕客户问题进行多来源调研与溯源,快速整理背景并支持准确回复。
帮助你快速查询指标、分析趋势成因,并生成面向干系人的数据报告。
用于统计分析数据分布、趋势、异常与显著性检验,辅助得出可靠结论
在分享分析结论前,检查方法、计算、偏差与结论是否可靠
运行 nf-core/Nextflow 流水线,完成 RNA-seq、变异检测与 ATAC-seq 数据分析
将查询结果或数据表快速生成适合报告与演示的高质量图表。
依据塔夫特原则设计高信息密度、清晰诚实的数据可视化方案与图表代码。
快速生成含图表、筛选器与表格的可分享交互式 HTML 仪表盘。
用于生成多种可视化图表,并辅助完成数据分析与展示表达。
帮助用户创作海报、插画等静态视觉作品,并导出为 PNG 或 PDF。
帮助用户创作海报、插画与静态视觉稿,并输出PNG或PDF文件