Registry / data / scienceplots

scienceplots

JSON →
library2.2.1pypypi✓ verified 85d ago

SciencePlots provides Matplotlib style sheets for scientific publications, offering preconfigured plots that match journal requirements (IEEE, Nature, etc.) and high-contrast color cycles. It requires an explicit `import scienceplots` statement (since v1.1.0). Current version is 2.2.1, with a relatively slow release cadence (every few months). Requires Python >=3.8.

pip install scienceplots
INSTALL
IMPORT
SIG · SCIENCEPLOTS
S
scienceplots
datapythonv2.2.1
Install
7.8s avg
Import
2093ms
Disk
181MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.2.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.918s · 177.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 7.8s · import 0.756s · 170MB
181MB installed
● package 181MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

scienceplots
import scienceplots
No import or `from scienceplots import ...`
Since v1.1.0, you must run `import scienceplots` at the top of your script to register the styles. Previously styles were auto-loaded on pip install.

Import scienceplots to register styles, then use `plt.style.use(...)` like any Matplotlib style.

import matplotlib.pyplot as plt import scienceplots # Apply 'science' style (uses LaTeX) plt.style.use('science') # Or without LaTeX: # plt.style.use(['science', 'no-latex']) fig, ax = plt.subplots() ax.plot([1, 2, 3], [1, 4, 9]) ax.set_xlabel('x') ax.set_ylabel('y') fig.savefig('figure.pdf')
Debug
Known issues
deprecatedOld usage without explicit `import scienceplots` no longer works since v1.1.0.
fix
Add `import scienceplots` at the top of your script.
affects: <1.1.0 vs >=1.1.0
gotchaThe default 'science' style requires LaTeX. If LaTeX is not installed, you'll get errors about missing `*.sty` files.
fix
Use `plt.style.use(['science', 'no-latex'])` to avoid LaTeX dependency.
affects: all
gotchaStyles are case-sensitive. Using `'SCIENCE'` or `'Science'` will fail silently (falls back to default).
fix
Use exact style names as documented: `'science'`, `'ieee'`, `'nature'`, etc.
affects: all
gotchaCombining styles with conflicting settings (e.g., two styles setting 'figure.facecolor') results in last style winning; order matters.
fix
Put the most specific style last in the list: `plt.style.use(['science', 'ieee'])` — 'ieee' overrides 'science' on conflicts.
affects: all
gotchaFonts may not appear as expected if the required LaTeX packages (like 'amsmath', 'sfmath') are missing; styles load them automatically.
fix
Ensure your LaTeX distribution is complete, or use `'no-latex'` styles.
affects: all
Errors
Common errors & fixes
AttributeError: module 'matplotlib.style' has no attribute 'use' (if import missing)
You forgot `import scienceplots` before using `plt.style.use('science')`.
fix
Add `import scienceplots` at the top of your script.
FileNotFoundError: [Errno 2] No such file or directory: '.../styles/science.mplstyle'
SciencePlots is not installed or styles not registered (often because `import scienceplots` is missing).
fix
Install scienceplots (`pip install scienceplots`) and `import scienceplots` in your script.
RuntimeError: Failed to process string with tex because LaTeX is not installed or missing packages
The 'science' style tries to use LaTeX but LaTeX is not installed.
fix
Use `plt.style.use(['science', 'no-latex'])` to disable LaTeX, or install a LaTeX distribution (e.g., TeX Live, MiKTeX).
UserWarning: Style 'science' does not exist; falling back to default
Typo in style name or styles not registered (missing import).
fix
Verify style name (e.g., 'science', 'ieee') and ensure `import scienceplots` is executed.
Upgrade
Version history
2.2.1latest on PyPI · released Feb 25, 2026
Audit
Dependencies
matplotlibrequiredCore plotting library; styles are applied to Matplotlib figures.
LaTeXoptionalRequired for styles that use LaTeX fonts (e.g., 'science' default).
Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
scienceplots — pip install scienceplots · libregistry