AgentSkillsCN

thesis-plot

生成符合论文格式要求的高质量科研图表,专注于时序异常检测可视化

SKILL.md
--- frontmatter
name: thesis-plot
description: 生成符合论文格式要求的高质量科研图表,专注于时序异常检测可视化
user-invocable: true

论文绘图技能

为农村电压异常检测论文生成符合学术规范的高质量图表。

支持的图表类型

时序可视化

类型代码名称用途
timeseries电压时序曲线展示三相电压变化和异常区间
reconstruction重构误差分布展示正常/异常样本的误差分布
detection检测结果对比展示预测结果与真实标签

性能评估

类型代码名称用途
comparison模型对比柱状图多模型多指标性能对比
rocROC曲线不同阈值下的性能
prPR曲线精确率-召回率曲线
confusion混淆矩阵分类性能详细分布
loss训练损失曲线训练过程可视化

特征分析

类型代码名称用途
tsnet-SNE降维高维特征分布可视化
pcaPCA降维主成分分析可视化
correlation相关性热力图特征相关性分析
radar雷达图电压质量指标展示

周期/频域分析

类型代码名称用途
fftFFT频谱图时序信号频域特征
period周期热力图TimesNet 2D周期建模

异常分析

类型代码名称用途
anomaly_dist异常类型分布不同异常类型占比
difference模型差异图多模型检测差异对比

快速使用

单图生成

bash
# 电压时序图
/plot type=timeseries data=dataset/RuralVoltage/test.csv

# 模型对比图
/plot type=comparison

# 混淆矩阵
/plot type=confusion model=TimesNet

# t-SNE 可视化
/plot type=tsne features=embeddings.npy labels=test_label.csv

批量生成

bash
# 生成第3章所有图表
/plot chapter=3 --all

# 生成第4章实验图表
/plot chapter=4 types=comparison,confusion,roc

参数说明

通用参数

参数类型默认值说明
typestring-图表类型(必需)
datapath-数据文件路径
outputpaththesis/figures/输出目录
formatstringpdf输出格式 (pdf/png/svg)
dpiint300分辨率
chapterint3章节号
fig_numintauto图编号
widthfloat7.0图宽度(英寸)
heightfloatauto图高度(英寸)

样式参数

参数类型默认值说明
stylestringthesis样式模板
colormapstringdefault颜色方案
font_cnstringSimHei中文字体
font_enstringTimes New Roman英文字体
gridbooltrue显示网格

标题参数

参数类型说明
title_cnstring中文标题
title_enstring英文标题
xlabelstringX轴标签
ylabelstringY轴标签

图表规格

论文格式标准

yaml
字体大小:
  标题: 五号 (10.5pt)
  坐标轴标签: 五号 (10.5pt)
  刻度标签: 小五号 (9pt)
  图例: 小五号 (9pt)

图片规格:
  单栏宽度: 3.5 英寸 (约 8.9 cm)
  双栏宽度: 7.0 英寸 (约 17.8 cm)
  最大宽度: 6.0 英寸 (约 15.2 cm,版心宽度)
  分辨率: 300 DPI

颜色方案:
  - '#1f77b4'  # 蓝色 - 主色
  - '#ff7f0e'  # 橙色
  - '#2ca02c'  # 绿色
  - '#d62728'  # 红色 - 异常标注
  - '#9467bd'  # 紫色

图例规范

yaml
位置: 自动最佳 (loc='best')
字体: 小五号 Times New Roman
边框: 黑色细线
透明度: 0.9
单列显示: 默认

输出示例

文件命名规则

code
fig_{chapter}_{number}_{type}.pdf

示例:
fig_3_1_voltage_timeseries.pdf
fig_3_2_model_comparison.pdf
fig_3_3_confusion_matrix.pdf
fig_4_1_tsne_visualization.pdf

生成结果

code
✅ 图表生成成功:
   - 文件: thesis/figures/chap3/fig_3_1_voltage_timeseries.pdf
   - 格式: PDF (矢量)
   - 尺寸: 7.0 x 3.5 英寸
   - 分辨率: 300 DPI

📝 LaTeX 引用代码:
   \begin{figure}[htbp]
     \centering
     \includegraphics[width=0.9\textwidth]{figures/chap3/fig_3_1_voltage_timeseries.pdf}
     \caption{农村电压三相时序曲线}
     \label{fig:voltage_timeseries}
   \end{figure}

高级用法

自定义样式

bash
/plot type=comparison \
  colormap=viridis \
  style=thesis \
  width=6.5 \
  title_cn="模型性能对比分析" \
  title_en="Model Performance Comparison"

子图组合

bash
/plot type=subplot \
  layout=2x2 \
  types=timeseries,confusion,roc,tsne \
  chapter=4 \
  fig_num=1

数据驱动

bash
# 从实验结果文件直接生成
/plot type=all \
  results=code/voltage_anomaly_detection/result_anomaly_detection.txt \
  chapter=4

依赖工具

python
# 核心依赖
matplotlib>=3.4.0
seaborn>=0.11.0
pandas>=1.3.0
numpy>=1.21.0
scikit-learn>=0.24.0

# 可选依赖
plotly>=5.0.0  # 交互式图表

相关资源

  • Agent: .claude/agents/thesis-plotter.md
  • 命令: .claude/commands/plot.md
  • 代码库: code/voltage_anomaly_detection/visualization/
  • 输出目录: thesis/figures/