创建适合出版质量的统计可视化需要大量的样板代码和设计决策。本技能提供对seaborn库函数的优化访问,用于生成箱线图、小提琴图、热力图和配对图,具有美观的默认样式和pandas集成功能。
Baixar o ZIP da skill
Upload no Claude
Vá em Configurações → Capacidades → Skills → Upload skill
Ative e comece a usar
Testar
A utilizar "seaborn". Create a box plot showing revenue by region using the sales_data DataFrame. Set region as x-axis and revenue as y-axis.
Resultado esperado:
一个箱线图,x轴显示地区,y轴显示收入,展示每个地区的中位数、四分位数和异常值。应用seaborn默认的清晰样式。
A utilizar "seaborn". Generate a heatmap of the correlation matrix from customer_data with annotations showing the correlation coefficients.
Resultado esperado:
一个方形热力图,单元格根据相关强度着色(红蓝发散调色板),每个单元格中有数值标注,以及显示刻度的颜色条图例。
A utilizar "seaborn". Create a violin plot of response times by priority level from support_data, with box inside showing quartiles.
Resultado esperado:
一个小提琴图,x轴显示优先级,y轴显示响应时间。每个小提琴显示完整分布,叠加的箱线图显示中位数和四分位数线条。
Auditoria de Segurança
SeguroAll static findings are false positives. The scanner incorrectly identified markdown documentation formatting (backticks for inline code) as shell command execution, library names as cryptographic algorithms, and standard metadata as network indicators. This is a legitimate statistical visualization skill with no malicious code or risky operations.
Pontuação de qualidade
O Que Você Pode Construir
探索数据集分布进行分析
使用箱线图和小提琴图快速生成跨类别组的分布比较,以识别实验或调查数据中的异常值和模式。
在笔记本中可视化相关矩阵
创建显示变量之间相关系数的标注热力图,以支持机器学习工作流程中的特征选择和多重共线性评估。
生成适合出版质量的图表
使用seaborn主题自定义功能,为学术论文、报告和演示文稿生成具有一致美学的样式化统计图形。
Tente Estes Prompts
使用seaborn技能创建箱线图,比较分类变量各组的值。使用sample_data DataFrame,'category'作为x轴,'value'作为y轴。应用seaborn默认主题并添加适当的标签。
使用seaborn技能生成小提琴图,显示experiment_data中'treatment_group'各组的'scores'分布。包含inner='box'选项以显示四分位数。使用专业配色方案并将图形尺寸设置为10x6。
使用seaborn创建热力图以可视化features_df的相关矩阵。标注单元格中的相关系数值,使用以0为中心的发散色彩图,并包含颜色条图例。设置适当的图形尺寸以便于阅读。
使用seaborn为iris_data的['sepal_length', 'sepal_width', 'petal_length', 'petal_width']列生成配对图。按物种着色,在下三角显示散点图,在对角线显示分布,使用12x12的子图网格尺寸。
Melhores Práticas
- 在为报告创建多个相关可视化时使用一致的图形尺寸(通过matplotlib图形参数设置)
- 在会话开始时应用一次seaborn主题设置(sns.set_theme),以确保所有生成图形的样式一致
- 选择适当的调色板(相关性使用发散型,数值大小使用顺序型)以准确表示数据关系
Evitar
- 避免创建过于复杂的可视化,包含过多类别(考虑先聚合或过滤数据)
- 不要对非常小的样本量使用箱线图,在这些情况下小提琴图或带状图能更好地显示分布
- 避免用过多的标注使图形混乱;保持标签和标题清晰简洁
Perguntas Frequentes
seaborn中箱线图和小提琴图有什么区别?
我可以将seaborn与存储在pandas DataFrame中的数据一起使用吗?
如何保存seaborn图表用于出版?
seaborn中有哪些可用的调色板?
如何全局自定义seaborn图形样式?
我可以在同一个图形中结合matplotlib和seaborn吗?
Detalhes do Desenvolvedor
Autor
K-Dense-AILicença
BSD-3-Clause license
Repositório
https://github.com/K-Dense-AI/claude-scientific-skills/tree/main/scientific-skills/seabornReferência
main
Estrutura de arquivos