Metadata-Version: 2.4
Name: sciplot-academic
Version: 1.14.0
Summary: 中文科研绘图库 — 基于 Matplotlib，专为中文论文场景优化
Author-email: SciPlot Team <sciplot@github.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/rippleshe/sciplot-academic
Project-URL: Repository, https://github.com/rippleshe/sciplot-academic
Project-URL: Documentation, https://sciplot.readthedocs.io
Project-URL: Issues, https://github.com/rippleshe/sciplot-academic/issues
Keywords: matplotlib,scientific-plotting,academic,publication,nature,ieee,thesis,chinese
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: matplotlib>=3.5.0
Requires-Dist: networkx>=3.1
Requires-Dist: numpy>=1.20.0
Requires-Dist: scienceplots>=2.1.0
Requires-Dist: tomli>=2.0.0; python_version < "3.11"
Provides-Extra: test
Requires-Dist: pytest>=8.0; extra == "test"
Requires-Dist: pytest-cov>=4.0; extra == "test"
Requires-Dist: pytest-xdist>=3.5; extra == "test"
Requires-Dist: coverage[toml]; extra == "test"
Requires-Dist: pandas>=2.2; python_version >= "3.11" and extra == "test"
Requires-Dist: pandas<3.0,>=2.2; python_version < "3.11" and extra == "test"
Provides-Extra: lint
Requires-Dist: ruff>=0.5; extra == "lint"
Requires-Dist: pre-commit; extra == "lint"
Provides-Extra: typing
Requires-Dist: mypy>=1.10; extra == "typing"
Provides-Extra: doc
Requires-Dist: sphinx>=7.0; extra == "doc"
Requires-Dist: pydata-sphinx-theme>=0.14; extra == "doc"
Requires-Dist: numpydoc>=1.0; extra == "doc"
Requires-Dist: sphinx-gallery>=0.17; extra == "doc"
Provides-Extra: dev
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: pytest-xdist>=3.5; extra == "dev"
Requires-Dist: coverage[toml]; extra == "dev"
Requires-Dist: ruff>=0.5; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: mypy>=1.10; extra == "dev"
Requires-Dist: sphinx>=7.0; extra == "dev"
Requires-Dist: pydata-sphinx-theme>=0.14; extra == "dev"
Requires-Dist: numpydoc>=1.0; extra == "dev"
Requires-Dist: sphinx-gallery>=0.17; extra == "dev"
Provides-Extra: ml
Requires-Dist: scikit-learn>=1.0.0; extra == "ml"
Provides-Extra: stats
Requires-Dist: scipy>=1.10.1; extra == "stats"
Provides-Extra: network
Requires-Dist: networkx>=2.6.0; extra == "network"
Provides-Extra: venn
Requires-Dist: matplotlib-venn>=0.11.0; extra == "venn"
Provides-Extra: all
Requires-Dist: scikit-learn>=1.0.0; extra == "all"
Requires-Dist: scipy>=1.10.1; extra == "all"
Requires-Dist: networkx>=2.6.0; extra == "all"
Requires-Dist: matplotlib-venn>=0.11.0; extra == "all"
Dynamic: license-file

# 🎨 SciPlot Academic

> **中文科研绘图默认方案** — 为论文、汇报和竞赛而生的专业级可视化库

[![PyPI version](https://badge.fury.io/py/sciplot-academic.svg)](https://badge.fury.io/py/sciplot-academic)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![GitHub repo](https://img.shields.io/badge/GitHub-rippleshe%2Fsciplot--academic-181717?logo=github)](https://github.com/rippleshe/sciplot-academic)
[![GitHub issues](https://img.shields.io/github/issues/rippleshe/sciplot-academic)](https://github.com/rippleshe/sciplot-academic/issues)

---

## ✨ 效果展示

<div align="center">

### 基础图表

<table>
  <tr>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/01_multi_line.png" width="100%">
      <br><b>多线对比图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/02_grouped_bar.png" width="100%">
      <br><b>分组柱状图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/03_scatter_regression.png" width="100%">
      <br><b>散点回归图</b>
    </td>
  </tr>
</table>

### 统计图表

<table>
  <tr>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/04_violin_box.png" width="100%">
      <br><b>小提琴图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/05_heatmap.png" width="100%">
      <br><b>热力图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/06_timeseries.png" width="100%">
      <br><b>时间序列图</b>
    </td>
  </tr>
</table>

### 高级图表

<table>
  <tr>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/07_radar.png" width="100%">
      <br><b>雷达图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/08_density.png" width="100%">
      <br><b>核密度图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/09_pca.png" width="100%">
      <br><b>PCA 降维可视化</b>
    </td>
  </tr>
</table>

### 扩展模块

<table>
  <tr>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/10_3d_surface.png" width="100%">
      <br><b>3D 曲面图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/11_network.png" width="100%">
      <br><b>网络社区图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/12_multi_panel.png" width="100%">
      <br><b>多面板组合图</b>
    </td>
  </tr>
</table>

### 进阶图表

<table>
  <tr>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/13_bubble_heatmap.png" width="100%">
      <br><b>气泡热力图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/14_waterfall3d.png" width="100%">
      <br><b>3D 瀑布图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/15_bubble.png" width="100%">
      <br><b>二维气泡图</b>
    </td>
  </tr>
  <tr>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/16_ridgeline.png" width="100%">
      <br><b>山脊图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/17_hexbin.png" width="100%">
      <br><b>六边形密度图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/18_marginal.png" width="100%">
      <br><b>边际分布图</b>
    </td>
  </tr>
  <tr>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/19_raincloud.png" width="100%">
      <br><b>雨云图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/20_beeswarm.png" width="100%">
      <br><b>蜂群图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/21_dumbbell.png" width="100%">
      <br><b>哑铃图</b>
    </td>
  </tr>
  <tr>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/22_gantt.png" width="100%">
      <br><b>甘特图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/23_packed_bubble.png" width="100%">
      <br><b>打包气泡图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/24_network3d.png" width="100%">
      <br><b>3D 网络图</b>
    </td>
  </tr>
  <tr>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/25_volcano.png" width="100%">
      <br><b>火山图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/26_calendar_heatmap.png" width="100%">
      <br><b>日历热图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/27_taylor.png" width="100%">
      <br><b>泰勒图</b>
    </td>
  </tr>
  <tr>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/28_chord.png" width="100%">
      <br><b>弦图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/29_ternary.png" width="100%">
      <br><b>三角相图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/30_waffle.png" width="100%">
      <br><b>华夫图</b>
    </td>
  </tr>
  <tr>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/31_sankey.png" width="100%">
      <br><b>桑基图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/32_treemap.png" width="100%">
      <br><b>矩形树图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/33_donut.png" width="100%">
      <br><b>环形图</b>
    </td>
  </tr>
  <tr>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/34_composite_condition_matrix.png" width="100%">
      <br><b>复合图：条件矩阵</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/35_composite_comparative.png" width="100%">
      <br><b>复合图：对照双列</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/36_composite_hub_spoke.png" width="100%">
      <br><b>复合图：中心-辐条</b>
    </td>
  </tr>
  <tr>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/37_composite_pipeline.png" width="100%">
      <br><b>复合图：流水线</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/38_composite_time_march.png" width="100%">
      <br><b>复合图：时间推进</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/39_streamgraph.png" width="100%">
      <br><b>流图</b>
    </td>
  </tr>
  <tr>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/40_circular_barplot.png" width="100%">
      <br><b>环形条形图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/41_waterfall.png" width="100%">
      <br><b>瀑布图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/42_forest.png" width="100%">
      <br><b>森林图（Meta 分析）</b>
    </td>
  </tr>
  <tr>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/43_funnel.png" width="100%">
      <br><b>漏斗图（发表偏倚）</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/44_bump.png" width="100%">
      <br><b>排名变化图</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/45_alluvial.png" width="100%">
      <br><b>冲积图（队列迁移）</b>
    </td>
  </tr>
  <tr>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/46_sunburst.png" width="100%">
      <br><b>旭日图（分层占比）</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/47_upset.png" width="100%">
      <br><b>UpSet 图（集合交集）</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/48_composite_triptych.png" width="100%">
      <br><b>复合图：临床三联画</b>
    </td>
  </tr>
  <tr>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/49_colorblind_okabe_ito.png" width="100%">
      <br><b>色盲安全：Okabe-Ito</b>
    </td>
    <td align="center" width="33%">
      <img src="https://raw.githubusercontent.com/rippleshe/sciplot-academic/master/showcase/50_composite_hero.png" width="100%">
      <br><b>复合图：Hero 主导面板</b>
    </td>
  </tr>
</table>

</div>

---

## 🌟 为什么选择 SciPlot？

```
┌─────────────────────────────────────────────────────────────────────────┐
│  SciPlot Academic = 专业配色 + 期刊样式 + 中文优化 + 智能辅助            │
└─────────────────────────────────────────────────────────────────────────┘
```

| 特性 | 说明 |
|------|------|
| **🎨 全内置配色** | 5 大基础色系 + 6 个人民币主题 + 2 个发散配色，零外部依赖 |
| **🀄 中文优化** | 默认宋体中文环境，IEEE 中文字号自动调优 |
| **📄 论文级输出** | Nature/IEEE/APS/Springer/Thesis 预置尺寸，Word/LaTeX 一键切换 |
| **📐 高下限默认** | 四边向内主/次刻度、完整轴脊、克制线宽、无框图例与高分辨率导出由底层统一兜底，随手调用也保持论文图完成度 |
| **🧠 智能配色** | ≤6 条线自动选择最优子集，支持自定义配色方案 |
| **📊 丰富图表** | 40+ 图表类型：折线/散点/柱状/箱线/小提琴/热力/气泡/山脊/六边形/瀑布/雷达/网络/3D/森林/漏斗/冲积/旭日/UpSet 等 |
| **🧠 复合图模板** | `figure_panels(template=...)` 一键生成 Nature 级多面板：条件矩阵/时间推进/对照双列/流水线/临床三联画 |
| **✨ 智能辅助** | 自动标签旋转、智能图例、布局优化、颜色对比度检查、标注自动对比色 |
| **🎯 色盲安全** | Okabe-Ito 色盲安全调色板 + `simulate_colorblind()`/`audit_palette()` 配色防线 |
| **🔌 扩展模块** | ML 可视化（PCA/混淆矩阵）+ 3D 可视化（曲面/等高线/散点/瀑布） |
| **🚀 增强 API** | `PlotResult` 链式调用、语法糖别名、上下文管理器 |
| **🌙 暗色主题** | `theme="dark"` 一键切换深色背景，适合演示与屏幕展示 |
| **⚙️ 配置系统** | `set_defaults()` 持久化默认值，`setup_style()` 自动读取 |

---

## 📦 安装

```bash
# 基础安装（uv 推荐）
uv pip install sciplot-academic

# 机器学习扩展
uv pip install sciplot-academic[ml]

# 统计图表扩展（Q-Q 图、Bland-Altman、核密度等）
uv pip install sciplot-academic[stats]

# 全部扩展（ML + 统计 + 网络 + 维恩图）
uv pip install sciplot-academic[all]
```

### 扩展模块导入

```python
# 机器学习可视化
from sciplot._ext.ml import plot_pca, plot_confusion_matrix, plot_learning_curve

# 3D 可视化
from sciplot._ext.plot3d import plot_surface, plot_contour, plot_3d_scatter
```

---

## ⚡ 快速上手

### 5 种 API 风格，满足所有场景

```python
import sciplot as sp
import numpy as np

x = np.linspace(0, 10, 200)

# ─────────────────────────────────────────────────────────────────────
# 风格 1: 传统 API（推荐用于复杂图表）
# ─────────────────────────────────────────────────────────────────────
fig, ax = sp.plot(x, np.sin(x), xlabel="时间 (s)", ylabel="电压 (V)")
sp.save(fig, "结果图")

# ─────────────────────────────────────────────────────────────────────
# 风格 2: 链式调用（推荐用于快速绘图）
# ─────────────────────────────────────────────────────────────────────
sp.style("nature").palette("pastel").plot(x, np.sin(x)).save("链式调用")

# ─────────────────────────────────────────────────────────────────────
# 风格 3: 简洁别名（推荐用于简单图表）
# ─────────────────────────────────────────────────────────────────────
sp.line(x, np.sin(x), xlabel="时间 (s)", ylabel="电压 (V)")

# ─────────────────────────────────────────────────────────────────────
# 风格 4: PlotResult 增强返回类型（推荐用于复杂链式操作）
# ─────────────────────────────────────────────────────────────────────
result = sp.PlotResult(*sp.plot(x, np.sin(x)))
result.xlabel("时间 (s)").ylabel("电压 (V)").save("PlotResult 示例")

# ─────────────────────────────────────────────────────────────────────
# 风格 5: 上下文管理器（推荐用于临时样式切换）
# ─────────────────────────────────────────────────────────────────────
with sp.style_context("ieee", palette="forest"):
    fig, ax = sp.plot(x, np.sin(x))
    sp.save(fig, "ieee_fig")

# ─────────────────────────────────────────────────────────────────────
# 风格 6: 暗色主题（演示/屏幕展示）
# ─────────────────────────────────────────────────────────────────────
with sp.style_context("presentation", theme="dark"):
    fig, ax = sp.plot(x, np.sin(x), xlabel="时间", ylabel="幅度")
    sp.save(fig, "dark_fig")
```

---

## 📊 图表类型总览

### 基础图表
| 函数 | 用途 | 别名 |
|------|------|------|
| `plot()` / `plot_line()` | 折线图 | `line()` |
| `plot_multi()` | 多线对比（自动配色） | `multi()` |
| `plot_scatter()` | 散点图 | `scatter()` |
| `plot_step()` | 阶梯图（CDF/直方） | `step()` |
| `plot_area()` | 面积图 | `area()` |

### 柱状图家族
| 函数 | 用途 | 别名 |
|------|------|------|
| `plot_bar()` | 单组柱状图 | `bar()` |
| `plot_grouped_bar()` | **分组柱状图**（论文最常用） | `grouped_bar()` |
| `plot_stacked_bar()` | 堆叠柱状图 | `stacked_bar()` |
| `plot_horizontal_bar()` | 水平柱状图 | `hbar()` |
| `plot_lollipop()` | 棒棒糖图（排名/重要性） | `lollipop()` |
| `plot_combo()` | 组合图（柱状 + 折线，双 Y 轴） | `combo()` |

### 分布图表
| 函数 | 用途 | 别名 |
|------|------|------|
| `plot_box()` | 箱线图 | `box()` |
| `plot_violin()` | 小提琴图 | `violin()` |
| `plot_histogram()` | 直方图 | `hist()` |
| `plot_heatmap()` | 热力图 | `heatmap()` |

### 误差与置信
| 函数 | 用途 | 别名 |
|------|------|------|
| `plot_errorbar()` | 误差条 | `errorbar()` |
| `plot_confidence()` | 置信区间 | `confidence()` |

### 时间序列
| 函数 | 用途 | 别名 |
|------|------|------|
| `plot_timeseries()` | 时间序列图 | `timeseries()` |
| `plot_multi_timeseries()` | 多条时序曲线 | `multi_timeseries()` |
| `plot_slope()` | 斜率图 | — |

### 统计诊断
| 函数 | 用途 | 别名 |
|------|------|------|
| `plot_residuals()` | 残差图（模型诊断） | `residuals()` |
| `plot_qq()` | Q-Q 图（正态性检验） | `qq()` |
| `plot_bland_altman()` | Bland-Altman 图（一致性分析） | `bland_altman()` |
| `plot_density()` | 核密度估计曲线 | `density()` |
| `plot_multi_density()` | 多组核密度对比 | `multi_density()` |

### 多维/进阶图表
| 函数 | 用途 | 别名 |
|------|------|------|
| `plot_radar()` | 雷达图 | `radar()` |
| `plot_parallel()` | 平行坐标图 | — |
| `plot_scatter_matrix()` | 散点矩阵图 | — |
| `plot_residuals()` | 残差图 | — |
| `plot_qq()` | Q-Q 图 | — |

### 网络与层次
| 函数 | 用途 |
|------|------|
| `plot_network()` | 网络图 |
| `plot_dendrogram()` | 层次聚类树状图 |
| `plot_venn2()` / `plot_venn3()` | 维恩图 |

### 标注工具
| 函数 | 用途 |
|------|------|
| `annotate_significance()` | 显著性标注（*/**/***） |
| `add_panel_labels()` | 添加 (a)(b)(c) 面板标签 |

---

## 🎨 配色系统

### 内置色系总览

```
┌─────────────────────────────────────────────────────────────────────┐
│  pastel     → 柔和粉彩（默认，6 色）                                  │
│  ocean      → 海洋蓝绿（6 色）                                       │
│  forest     → 森林渐变（6 色）                                       │
│  sunset     → 日落暖色（5 色）                                       │
│  earth      → 大地色系（5 色）                                       │
│  rmb        → 人民币配色（6 个面额主题）                              │
│  diverging  → 发散配色（rdbu / coolwarm）                             │
└─────────────────────────────────────────────────────────────────────┘
```

### 自定义配色

```python
# 简单配色
sp.set_custom_palette(["#E74C3C", "#3498DB"])

# 完整配色方案注册
sp.register_color_scheme("mytheme", scheme)
```

---

## 📐 期刊样式

| venue | 尺寸 (英寸) | 适用场景 |
|-------|-------------|----------|
| `nature` | 7.0 × 5.0 | Nature/Science 双栏 |
| `ieee` | 3.5 × 3.0 | IEEE 单栏 |
| `aps` | 3.4 × 2.8 | APS Physical Review |
| `springer` | 6.0 × 4.5 | Springer 期刊 |
| `thesis` | 6.1 × 4.3 | 学位论文 |
| `presentation` | 8.0 × 5.5 | 16:9 演示文稿 |

---

## 🔧 高级功能

### 分组柱状图（论文最常见）

```python
sp.plot_grouped_bar(
    groups=["A", "B", "C"],
    data={"方法 1": [1, 2, 3], "方法 2": [2, 3, 4]}
)
```

### 堆叠柱状图

```python
sp.plot_stacked_bar(
    categories=["A", "B", "C"],
    data={"训练": [80, 85, 90], "验证": [10, 8, 5]}
)
```

### 组合图（柱状 + 折线，双 Y 轴）

```python
sp.plot_combo(
    x=["Q1", "Q2", "Q3"],
    bar_data={"销量": [100, 120, 140]},
    line_data={"增长率": [0.1, 0.2, 0.15]}
)
```

### 显著性标注

```python
sp.annotate_significance(ax, x1=1, x2=2, y=8.5, p_value=0.03)  # *
```

### 智能辅助工具

```python
sp.auto_rotate_labels(ax)           # 自动旋转标签避免重叠
sp.smart_legend(ax, outside=True)   # 智能图例位置
sp.optimize_layout(fig)             # 自动优化布局
sp.check_color_contrast("#FFF", "#000")  # 颜色对比度检查
```

---

## 🤖 AI Agent 集成

### 默认触发规则

> **⚠️ 重要提示**：本项目附带 **sciplot** skill（`.claude/skills/sciplot/`），这是**默认绘图入口**。只要用户在对话里提到**画图、出图、可视化、图表、figure、plot、matplotlib、seaborn、plotly、论文插图、竞赛图或实验结果展示**，就**先走这个 skill**。只有当用户明确要求不用 SciPlot，或需求明显超出本包能力时，才退回通用方案。

使用 SciPlot 技能时，请参考 [`.claude/skills/sciplot/SKILL.md`](./.claude/skills/sciplot/SKILL.md)。该文件包含完整的函数签名、场景选型速查和最佳实践规范。

> GitHub Copilot 的仓库级提示见 [`.github/copilot-instructions.md`](./.github/copilot-instructions.md)。

### 标准代码结构

```python
"""
科研绘图脚本
依赖：uv pip install sciplot-academic
运行：python plot_result.py
"""
import numpy as np
import sciplot as sp

# 数据准备
x = np.linspace(0, 10, 200)
y1, y2 = np.sin(x), np.cos(x)

# 绘图
sp.setup_style("thesis", "pastel-2", lang="zh")
fig, ax = sp.plot(x, y1, xlabel="时间 (s)", ylabel="幅度")
sp.save(fig, "结果", formats=("png",), dpi=1200)

print("✓ 已保存")
```

---

## 🎯 最佳实践

### 黄金法则

```
┌─────────────────────────────────────────────────────────────────────┐
│  1. Word 用 PNG 1200 DPI，LaTeX 用 PDF                               │
│  2. 多子图用 paper_subplots() 锁定总宽                               │
│  3. 中文用 lang="zh"，英文用 lang="en"                               │
│  4. ≥4 条线用 use_linestyles=True（色盲友好）                        │
│  5. 必须生成独立可运行的 Python 脚本                                  │
└─────────────────────────────────────────────────────────────────────┘
```

### 场景推荐

| 用户场景 | Venue | 格式 | DPI | 语言 |
|---------|-------|------|-----|------|
| Word 中文论文 | `thesis` | PNG | 1200 | zh |
| IEEE 英文投稿 | `ieee` | PDF | — | en |
| Nature 英文投稿 | `nature` | PDF | — | en |
| 学位论文 | `thesis` | PNG/PDF | 1200 | zh |
| 演示文稿 | `presentation` | PNG | 300 | zh/en |

---

## 📚 完整文档

详细文档请查阅 [`.claude/skills/sciplot/references/`](./.claude/skills/sciplot/references/) 目录：

| 文档 | 说明 |
|------|------|
| [full-api.md](./.claude/skills/sciplot/references/full-api.md) | 完整 API 参考（全部函数签名） |
| [recipes.md](./.claude/skills/sciplot/references/recipes.md) | 场景配方（论文/期刊/竞赛/PPT） |
| [color-style.md](./.claude/skills/sciplot/references/color-style.md) | 配色方案与样式详解 |

---

## 🔗 相关链接

- **PyPI**: https://pypi.org/project/sciplot-academic/
- **GitHub**: https://github.com/rippleshe/sciplot-academic
- **问题反馈**: https://github.com/rippleshe/sciplot-academic/issues

---

## 📄 License

MIT © SciPlot Team

---

<div align="center">

**🎨 让科研绘图更简单 · 让论文配图更专业**

[文档](#-完整文档) · [示例](#-快速上手) · [安装](#-安装)

</div>
