academic-figures
Skill1 starsChanged 32 days agoApache-2.0View on GitHub
按期刊与学位论文要求规范学术图表:用 SciencePlots 统一风格、解决中文字体、按 600/300 dpi 与矢量优先导出 PDF/EPS,并核对线宽、字号、双栏宽度等硬指标。当用户要画论文插图、生成符合投稿要求的图表或优化 matplotlib 出图时使用。
- Installs packages
2 other projects use a version of this.
Adopted by
Most recently taken up by
- docsor1212/academic-figurestheir own version, first seen Oct 26, 2026
- sai-tv/academic-figurestheir own version, first seen Feb 26, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- sai-tv/academic-figures★ 12same name
- docsor1212/academic-figures★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- llms.txtllms.txt
- citation-managementSkill
- cn-literatureSkill
- cpp-workflowSkill
- data-analysisSkill
- design-materialSkill
- doc-batchSkill
- email-calendarSkill
- lab-reportSkill
- math-modelingSkill
- meeting-notesSkill
- office-docsSkill
- paper-researchSkill
- python-workflowSkill
- study-tutorSkill
- thesis-formatSkill
- web-researchSkill
The file
Files
学术图表规范
目标:让 matplotlib 出的图符合期刊 / 学位论文的硬要求,并且中文不出方框。
1. 统一风格:SciencePlots
安装(pip 名 SciencePlots,import 名是 scienceplots):
python3 -m pip install SciencePlots用法:
import matplotlib.pyplot as plt
import scienceplots
plt.style.use(['science', 'no-latex'])science:基础学术风格;no-latex:不强制走 LaTeX 渲染(不装 LaTeX 也能用)- 可叠加,如
['science', 'ieee'](IEEE 风格)、['science', 'grid'] - 样式必须在绘图前设置
2. ⚠️ 中文方框问题
SciencePlots 默认偏西文 serif 字体,中文会显示成方框(tofu)。必须另配中文字体:
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] = [
'Noto Sans CJK SC', 'Source Han Sans SC', # Linux / 通用
'PingFang SC', 'Heiti SC', 'Arial Unicode MS', # macOS
'Microsoft YaHei', 'SimHei', # Windows
]
plt.rcParams['axes.unicode_minus'] = False # 负号变方框时加- 要求宋体:把列表换成
['SimSun', 'Songti SC', 'Noto Serif CJK SC'] - 要求黑体:
['SimHei', 'Heiti SC', 'Noto Sans CJK SC'] font.sans-serif是候选列表,系统里第一个存在的会被用上- 找不到字体不报错,静默退回仍显示方框 —— 必须实际看图确认
- 先查本机有哪些中文字体:
from matplotlib import font_manager
names = sorted({f.name for f in font_manager.fontManager.ttflist})
print([n for n in names if any(k in n for k in ('Hei','Song','YaHei','CJK','PingFang','Han','Sun'))])- 无显示器环境加
matplotlib.use('Agg')(放在 import pyplot 之前)
3. 导出矢量图(正确姿势)
plt.savefig('fig1.pdf', format='pdf', bbox_inches='tight')- 矢量优先:PDF / EPS / SVG,缩放不失真
bbox_inches='tight'去白边- 需要位图时(≥300 dpi):
plt.savefig('fig1.png', dpi=600, bbox_inches='tight')- ⚠️ 位图不能转矢量:截图、照片、Excel 截图这类像素图无法「转换」成矢量,必须拿原始数据重绘
- 不要用 JPG(有损);需要位图用 PNG / TIFF
4. 期刊 / 学位论文常见硬要求(逐项核对)
- 分辨率:线图 ≥600 dpi,位图(照片等)≥300 dpi
- 格式:矢量优先(PDF / EPS / SVG)
- 中文字体:常见要求宋体 / 黑体;西文:Arial / Times New Roman
- 线宽 ≥0.5 pt(
plt.rcParams['axes.linewidth']、lines.linewidth) - 字号:坐标轴刻度、图注不小于正文字号(常见 7–9 pt)
- 坐标轴:标注物理量与单位,如
时间 (s)、速度 (m/s) - 刻度:主/次刻度是否都要,刻度朝内还是朝外(按期刊要求)
- 图注:放图下方,表注放表上方
- 单栏 / 双栏宽度:按版式设
figsize(单栏约 8 cm,双栏约 16–17 cm) - 颜色:黑白打印与色盲读者可辨(用线型/标记区分,不要只靠颜色)
- 图内文字与图注语言一致(中文论文用中文,英文论文用英文)
5. 常用设置片段
import matplotlib.pyplot as plt
import scienceplots
plt.style.use(['science', 'no-latex'])
plt.rcParams['font.sans-serif'] = ['SimSun', 'Songti SC', 'Noto Serif CJK SC']
plt.rcParams['axes.unicode_minus'] = False
plt.rcParams['axes.linewidth'] = 0.8 # 边框线宽
plt.rcParams['lines.linewidth'] = 1.2
plt.rcParams['font.size'] = 9
fig, ax = plt.subplots(figsize=(3.5, 2.6)) # 单栏约 8.9 cm
ax.plot(x, y, label='实验值')
ax.set_xlabel('时间 (s)')
ax.set_ylabel('速度 (m/s)')
ax.legend()
fig.savefig('fig1.pdf', format='pdf', bbox_inches='tight')6. 常见坑
- SciencePlots 样式设晚了 → 不生效(必须在绘图前)
- 中文方框 → 没配中文字体,或配了系统里不存在的字体名
- 导出成 JPG → 有损、非矢量
- 忘记
bbox_inches='tight'→ 白边太大 - 位图强行「矢量化」 → 结果仍是位图轮廓,必须重绘
- 只按颜色区分曲线 → 黑白打印 / 色盲读者无法分辨
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

