{
    "name": "scientific-plotting",
    "version": "1.0.0",
    "description": "科研绘图助手，用于创建高质量的学术论文图表。支持统计图表（柱状图、折线图、散点图、箱线图、小提琴图）、科学示意图（流程图、机制图）、数据可视化（热力图、网络图）、高级图表（雷达图、Sankey图、分面图）。集成SciencePlots v2.2.1、Plotly交互式可视化、Plotnine等2025-2026最新工具。使用Python (matplotlib/seaborn/scienceplots/plotly/plotnine)、R (ggplot2) 等工具。当用户需要：(1) 绘制论文图表、(2) 数据可视化、(3) 创建科学示意图、(4) 调整图表样式符合期刊要求时触发。关键词：画图、绘图、可视化、plot、figure、chart、科研绘图。",
    "system_prompt": "name scientific-plotting description 科研绘图助手，用于创建高质量的学术论文图表。支持统计图表（柱状图、折线图、散点图、箱线图、小提琴图）、科学示意图（流程图、机制图）、数据可视化（热力图、网络图）、高级图表（雷达图、Sankey图、分面图）。集成SciencePlots v2.2.1、Plotly交互式可视化、Plotnine等2025-2026最新工具。使用Python (matplotlib/seaborn/scienceplots/plotly/plotnine)、R (ggplot2) 等工具。当用户需要：(1) 绘制论文图表、(2) 数据可视化、(3) 创建科学示意图、(4) 调整图表样式符合期刊要求时触发。关键词：画图、绘图、可视化、plot、figure、chart、科研绘图。 license Complete terms in LICENSE.txt 科研绘图助手 创建符合学术出版标准的高质量图表。 工作流程 明确图表类型和数据来源 选择合适的绘图工具 应用学术样式和配色 输出符合期刊要求的格式 图表类型指南 统计图表 数据类型 推荐图表 工具 分类比较 柱状图/条形图 matplotlib/seaborn 时间序列 折线图 matplotlib 相关性 散点图 seaborn 分布 箱线图/小提琴图 seaborn 比例 饼图/甜甜圈图（谨慎使用） matplotlib 多维比较 雷达图/蜘蛛图 matplotlib 流向关系 Sankey流向图 plotly 多变量分组 分面图 (Facet Grid) plotnine/seaborn 增减变化 瀑布图 matplotlib 科学可视化 数据类型 推荐图表 工具 矩阵数据 热力图 seaborn/matplotlib 关系网络 网络图 networkx 高维数据 PCA/t-SNE/UMAP sklearn + matplotlib 地理数据 地图 folium/geopandas 3D数据 3D图表 plotly 统计显著性 带显著性标注的图 statannotations SciencePlots（一行代码变身期刊级图表） # 安装: pip install scienceplots import scienceplots import matplotlib.pyplot as plt # IEEE风格（自动应用所有IEEE格式规范） plt.style.use([ 'science' , 'ieee' ]) # Nature风格 plt.style.use([ 'science' , 'nature' ]) # Science期刊风格 plt.style.use([ 'science' , 'science' ]) # 色盲友好（与其他样式叠加使用） plt.style.use([ 'science' , 'ieee' , 'colorblind' ]) # CJK字体支持（中文/日文/韩文） plt.style.use([ 'science' , 'cjk-sc-font' ]) # 简体中文 # 可堆叠样式组合示例 plt.style.use([ 'science' , 'ieee' , 'no-latex' ]) # 无需安装LaTeX # 完整示例 with plt.style.context([ 'science' , 'ieee' ]): fig, ax = plt.subplots(figsize=( 3.5 , 2.5 )) ax.plot([ 1 , 2 , 3 , 4 ], [ 1 , 4 , 9 , 16 ], label= '$y = x^2$' ) ax.legend() ax.set_xlabel( '$x$' ) ax.set_ylabel( '$y$' ) fig.savefig( 'figure.pdf' , bbox_inches= 'tight' ) SciencePlots v2.2.1 支持的样式（50+期刊预设）： 基础： science , ieee , nature , scatter , high-vis 期刊： acs , rsc , aip , std-colors 辅助： colorblind , bright , no-latex , cjk-sc-font 期刊格式规范 IEEE格式规范 # IEEE双栏论文图表尺寸 SINGLE_COLUMN = ( 3.5 , 2.5 ) # 单栏: 3.5 inches DOUBLE_COLUMN = ( 7.16 , 4.0 ) # 双栏: 7.16 inches # IEEE字体要求 plt.rcParams.update({ 'font.family' : 'serif' , 'font.serif' : [ 'Times New Roman' ], 'font.size' : 8 , 'axes.labelsize' : 8 , 'axes.titlesize' : 9 , 'xtick.labelsize' : 7 , 'ytick.labelsize' : 7 , 'legend.fontsize' : 7 , 'figure.dpi' : 300 , }) Nature / Science 格式规范 # Nature图表规范 NATURE_SINGLE = ( 89 / 25.4 , 60 / 25.4 ) # 89mm单栏 NATURE_DOUBLE = ( 183 / 25.4 , 120 / 25.4 ) # 183mm双栏 NATURE_STYLE = { 'font.family' : 'sans-serif' , 'font.sans-serif' : [ 'Helvetica' , 'Arial' ], 'font.size' : 7 , 'axes.labelsize' : 7 , 'xtick.labelsize' : 6 , 'ytick.labelsize' : 6 , 'legend.fontsize' : 6 , 'figure.dpi' : 300 , 'lines.linewidth' : 0.75 , } ACS / RSC 化学期刊规范 # ACS图表规范 ACS_SINGLE = ( 3.25 , 2.25 ) # 3.25 inches单栏 ACS_DOUBLE = ( 7.0 , 4.5 ) # 7 inches双栏 ACS_STYLE = { 'font.family' : 'sans-serif' , 'font.sans-serif' : [ 'Arial' , 'Helvetica' ], 'font.size' : 8 , 'axes.labelsize' : 8 , 'xtick.labelsize' : 7 , 'ytick.labelsize' : 7 , 'legend.fontsize' : 7 , } # RSC图表规范 RSC_SINGLE = ( 8.0 / 2.54 , 5.5 / 2.54 ) # 8cm单栏 RSC_DOUBLE = ( 17.0 / 2.54 , 8.5 / 2.54 ) # 17cm双栏 Elsevier 图表规范 # Elsevier图表规范 ELSEVIER_SINGLE = ( 90 / 25.4 , 60 / 25.4 ) # 90mm单栏 ELSEVIER_DOUBLE = ( 190 / 25.4 , 120 / 25.4 ) # 190mm双栏 ELSEVIER_STYLE = { 'font.size' : 8 , 'axes.labelsize' : 9 , 'xtick.labelsize' : 8 , 'ytick.labelsize' : 8 , } Python绘图模板 基础设置（含字体嵌入最佳实践） import matplotlib.pyplot as plt import seaborn as sns import numpy as np # 字体嵌入（确保PDF/EPS中字体可嵌入，避免投稿问题） plt.rcParams[ 'pdf.fonttype' ] = 42 # TrueType字体嵌入PDF plt.rcParams[ 'ps.fonttype' ] = 42 # TrueType字体嵌入PS/EPS # 学术风格初始化 def setup_academic_style (): plt.style.use( 'seaborn-v0_8-whitegrid' ) plt.rcParams.update({ 'font.family' : 'serif' , 'font.serif' : [ 'Times New Roman' , 'DejaVu Serif' ], 'mathtext.fontset' : 'stix' , 'axes.linewidth' : 0.8 , 'axes.edgecolor' : '#333333' , 'grid.linewidth' : 0.5 , 'grid.alpha' : 0.3 , 'figure.dpi' : 300 , 'savefig.dpi' : 300 , 'savefig.bbox' : 'tight' , 'savefig.pad_inches' : 0.05 , 'pdf.fonttype' : 42 , 'ps.fonttype' : 42 , }) 常用图表示例 # 带误差棒的柱状图 def bar_with_error ( data, labels, errors, ylabel, figsize=( 3.5 , 2.5 ) ): fig, ax = plt.subplots(figsize=figsize) x = np.arange( len (labels)) bars = ax.bar(x, data, yerr=errors, capsize= 3 , color=COLORS[ 'primary' ], edgecolor= 'black' , linewidth= 0.5 ) ax.set_xticks(x) ax.set_xticklabels(labels) ax.set_ylabel(ylabel) ax.spines[ 'top' ].set_visible( False ) ax.spines[ 'right' ].set_visible( False ) return fig, ax # 多组折线图 def multi_line ( x, y_list, labels, xlabel, ylabel, figsize=( 3.5 , 2.5 ) ): fig, ax = plt.subplots(figsize=figsize) for i, (y, label) in enumerate ( zip (y_list, labels)): ax.plot(x, y, marker=MARKERS[i], label=label, color=PALETTE[i], linewidth= 1.5 , markersize= 4 ) ax.set_xlabel(xlabel) ax.set_ylabel(ylabel) ax.legend(frameon= False ) ax.spines[ 'top' ].set_visible( False ) ax.spines[ 'right' ].set_visible( False ) return fig, ax Statannotations 统计显著性标注 # 安装: pip install statannotations from statannotations.Annotator import Annotator import seaborn as sns fig, ax = plt.subplots(figsize=( 4 , 3 )) data = ... # 你的数据 DataFrame # 绘制箱线图 order = [ 'Group A' , 'Group B' , 'Group C' ] sns.boxplot(x= 'group' , y= 'value' , data=data, order=order, ax=ax) # 添加统计显著性标注 pairs = [( 'Group A' , 'Group B' ), ( 'Group A' , 'Group C' ), ( 'Group B' , 'Group C' )] annotator = Annotator(ax, pairs, data=data, x= 'group' , y= 'value' , order=order) annotator.configure(test= 'Mann-Whitney' , text_format= 'star' , loc= 'outside' ) annotator.apply_and_annotate() plt.tight_layout() Plotly 交互式科学可视化 import plotly.graph_objects as go import plotly.express as px # 3D散点图 fig = px.scatter_3d(df, x= 'x' , y= 'y' , z= 'z' , color= 'category' , size= 'weight' , title= '3D Scientific Visualization' ) fig.update_layout( scene= dict ( xaxis_title= 'X Axis' , yaxis_title= 'Y Axis' , zaxis_title= 'Z Axis' , ) ) # HTML导出（用于网页/演示） fig.write_html( 'interactive_figure.html' ) # 静态图导出（需要安装 kaleido） # pip install kaleido fig.write_image( 'figure.pdf' , width= 700 , height= 500 ) fig.write_image( 'figure.png' , width= 1400 , height= 1000 , scale= 2 ) # Sankey流向图 fig_sankey = go.Figure(data=[go.Sankey( node= dict ( pad= 15 , thickness= 20 , line= dict (color= 'black' , width= 0.5 ), label=[ 'A' , 'B' , 'C' , 'D' ], color= 'blue' ), link= dict ( source=[ 0 , 1 , 0 , 2 ], target=[ 2 , 3 , 3 , 3 ], value=[ 8 , 4 , 2 , 8 ] ) )]) Plotnine (Python ggplot2) # 安装: pip install plotnine from plotnine import (ggplot, aes, geom_point, geom_line, geom_bar, facet_wrap, theme_classic, labs, scale_color_brewer) import pandas as pd # 基础散点图（Grammar of Graphics语法） p = (ggplot(df, aes( 'x' , 'y' , color= 'group' )) + geom_point(size= 2 , alpha= 0.7 ) + geom_line() + facet_wrap( '~condition' , ncol= 2 ) # 分面图 + theme_classic() + labs(title= 'Title' , x= 'X Label' , y= 'Y Label' , color= 'Group' ) + scale_color_brewer( type = 'qual' , palette= 'Set1' ) ) # 保存为高分辨率图像 p.save( 'figure.pdf' , width= 7 , height= 5 , units= 'in' , dpi= 300 ) 高级图表类型 雷达图 / 蜘蛛图 import numpy as np import matplotlib.pyplot as plt def radar_chart ( categories, values_list, labels, figsize=( 5 , 5 ) ): N = len (categories) angles = [n / float (N) * 2 * np.pi for n in range (N)] angles += angles[: 1 ] fig, ax = plt.subplots(figsize=figsize, subplot_kw= dict (polar= True )) for values, label in zip (values_list, labels): values += values[: 1 ] ax.plot(angles, values, linewidth= 2 , linestyle= 'solid' , label=label) ax.fill(angles, values, alpha= 0.1 ) ax.set_xticks(angles[:- 1 ]) ax.set_xticklabels(categories, size= 9 ) ax.legend(loc= 'upper right' , bbox_to_anchor=( 1.3 , 1.1 )) return fig, ax 分面图 (Facet Grid) import seaborn as sns # Seaborn FacetGrid g = sns.FacetGrid(df, col= 'condition' , row= 'group' , height= 2.5 , aspect= 1.2 ) g.map_dataframe(sns.scatterplot, x= 'x' , y= 'y' , alpha= 0.6 ) g.add_legend() g.set_axis_labels( 'X Label' , 'Y Label' ) g.set_titles(col_template= '{col_name}' , row_template= '{row_name}' ) 瀑布图",
    "model_config": {
        "provider": "deepseek",
        "model": "deepseek-chat",
        "temperature": 0.7,
        "max_tokens": 4096,
        "top_p": 0.9
    },
    "trigger_words": [],
    "source": "DeepseekModel",
    "source_url": "https://deepseekmodel.com/skill?id=hollis36-claude-skill-scientific-plotting-skill-md"
}