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.5.0.tar.gz (18.2 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.5.0-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sciplot_academic-1.5.0.tar.gz
  • Upload date:
  • Size: 18.2 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.5.0.tar.gz
Algorithm Hash digest
SHA256 115bf87250ebbd854a3f5d612a6222615beca6b0486153e8dac8f5fe25ff9f05
MD5 2fb22ea40f4e71c6ce0c86f1454bcca5
BLAKE2b-256 ed6cc86c39817e2c14f3d04c3e281b5bcc0ae351464012bf7069685b34d4a72f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sciplot_academic-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b05c395e6097a25af41a7e044f20896b3aff368785908991feeb9ff30dee2151
MD5 135d6cd365208fe2996652ef352865fd
BLAKE2b-256 77ce01f98f25f051406242487e0c1d7dfdb46e09016f233b72108fa0de8e6918

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