Skip to main content

期刊级科研绘图库 — 基于 Matplotlib + SciencePlots,专为中文科研场景优化

Project description

SciPlot Academic

期刊级科研绘图库 — 基于 Matplotlib + SciencePlots,专为中文科研场景优化

PyPI version Python 3.8+ License: MIT


安装

# pip
pip install sciplot-academic

# uv(推荐)
uv pip install sciplot-academic

# conda(需要先 pip 安装 scienceplots)
conda install -c conda-forge matplotlib numpy
pip install scienceplots sciplot-academic

三行代码画出期刊图

import sciplot as sp
import numpy as np

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

# 单线图(中文 + Nature 样式)
fig, ax = sp.plot(x, np.sin(x), xlabel="时间 (s)", ylabel="电压 (V)")
sp.save(fig, "结果图")   # → 结果图.pdf + 结果图.png(1200 DPI)

# 多线对比(2条线自动用 pastel-2 配色)
fig, ax = sp.plot_multi(
    x, [np.sin(x), np.cos(x)],
    labels=["方法 A", "方法 B"],
    xlabel="迭代次数", ylabel="准确率 (%)"
)
sp.save(fig, "对比结果")

核心特性

期刊样式(venue)

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 学位论文(A4 版心 15.5cm)
presentation 8.0 × 5.5 幻灯片/演示

三大常驻配色系

配色 风格 子集
pastel(默认) 柔和粉彩 pastel-1/2/3/4
earth 大地色系 earth-1/2/3/4
ocean 海洋蓝绿 ocean-1/2/3/4

plot_multi() 根据线条数自动选择对应子集(N≤4)。

其他配色:rainbow-N(N=1-23)、brightvibrantmuted100yuan 等。

图表类型

sp.plot(x, y)                     # 单线图
sp.plot_multi(x, [y1, y2])        # 多线图(智能配色)
sp.plot_scatter(x, y)             # 散点图
sp.plot_bar(categories, values)   # 柱状图
sp.plot_box(data_list)            # 箱线图
sp.plot_violin(data_list)         # 小提琴图
sp.plot_errorbar(x, y, yerr)      # 误差条图
sp.plot_confidence(x, mean, std)  # 置信区间图
sp.plot_heatmap(data)             # 热力图
sp.plot_histogram(data)           # 直方图

Word 论文 vs LaTeX 论文

Word 中文论文 → 保存为 PNG

sp.setup_style("thesis", "pastel-2", lang="zh")
fig, ax = sp.new_figure("thesis")        # 6.1in ≈ A4 Word 版心宽
ax.plot(x, y, label="结果")
ax.set_xlabel("时间 (s)"); ax.set_ylabel("幅度")
ax.legend()
sp.save(fig, "word图", formats=("png",), dpi=1200)

LaTeX IEEE 投稿 → 保存为 PDF

sp.setup_style("ieee", "pastel-2", lang="en")
fig, ax = sp.new_figure("ieee")          # 3.5in = \columnwidth
ax.plot(x, y1, label="Method A")
ax.plot(x, y2, label="Method B")
ax.set_xlabel("Time (s)"); ax.set_ylabel("Accuracy")
ax.legend(frameon=False)
sp.save(fig, "fig1", formats=("pdf",))
# LaTeX: \includegraphics[width=\columnwidth]{fig1.pdf}

依赖

  • matplotlib >= 3.5.0
  • numpy >= 1.20.0
  • SciencePlots >= 2.0.0

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sciplot_academic-1.4.0.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sciplot_academic-1.4.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file sciplot_academic-1.4.0.tar.gz.

File metadata

  • Download URL: sciplot_academic-1.4.0.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for sciplot_academic-1.4.0.tar.gz
Algorithm Hash digest
SHA256 c6eda22679fdf53d988cf7af1b192653d892781e632ac325d36320e0364a7477
MD5 0d4cfd48278e053696f7b16b31faac76
BLAKE2b-256 00d88f8efa8a0b531413349d1a0fc626fbf701f30a431237a9887fa49eb1e89c

See more details on using hashes here.

File details

Details for the file sciplot_academic-1.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sciplot_academic-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf07b58cd324fb0bb333ee48496367e9fba444f86730e8eac5b74d9086803652
MD5 f11fdf831ed795572bcb7d581582f086
BLAKE2b-256 8ba1d4d997594d0369f711116c1174e11a6a781d8cf563258fba17b0141eacb5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page