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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.918s · 177.8MB
glibcpy 3.10–3.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.fixAdd `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.fixUse `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).fixUse 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.fixPut 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.fixEnsure 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')`.
fixAdd `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).
fixInstall 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.
fixUse `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).
fixVerify 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).