{"id":24559,"library":"scienceplots","title":"SciencePlots","description":"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.","status":"active","version":"2.2.1","language":"python","source_language":"en","source_url":"https://github.com/garrettj403/SciencePlots","tags":["matplotlib","science-plots","stylesheets","publication","latex"],"install":[{"cmd":"pip install scienceplots","lang":"bash","label":"PyPI"},{"cmd":"conda install -c conda-forge scienceplots","lang":"bash","label":"conda-forge"}],"dependencies":[{"reason":"Core plotting library; styles are applied to Matplotlib figures.","package":"matplotlib","optional":false},{"reason":"Required for styles that use LaTeX fonts (e.g., 'science' default).","package":"LaTeX","optional":true}],"imports":[{"note":"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.","wrong":"No import or `from scienceplots import ...`","symbol":"scienceplots","correct":"import scienceplots"}],"quickstart":{"code":"import matplotlib.pyplot as plt\nimport scienceplots\n\n# Apply 'science' style (uses LaTeX)\nplt.style.use('science')\n\n# Or without LaTeX:\n# plt.style.use(['science', 'no-latex'])\n\nfig, ax = plt.subplots()\nax.plot([1, 2, 3], [1, 4, 9])\nax.set_xlabel('x')\nax.set_ylabel('y')\nfig.savefig('figure.pdf')","lang":"python","description":"Import scienceplots to register styles, then use `plt.style.use(...)` like any Matplotlib style."},"warnings":[{"fix":"Add `import scienceplots` at the top of your script.","message":"Old usage without explicit `import scienceplots` no longer works since v1.1.0.","severity":"deprecated","affected_versions":"<1.1.0 vs >=1.1.0"},{"fix":"Use `plt.style.use(['science', 'no-latex'])` to avoid LaTeX dependency.","message":"The default 'science' style requires LaTeX. If LaTeX is not installed, you'll get errors about missing `*.sty` files.","severity":"gotcha","affected_versions":"all"},{"fix":"Use exact style names as documented: `'science'`, `'ieee'`, `'nature'`, etc.","message":"Styles are case-sensitive. Using `'SCIENCE'` or `'Science'` will fail silently (falls back to default).","severity":"gotcha","affected_versions":"all"},{"fix":"Put the most specific style last in the list: `plt.style.use(['science', 'ieee'])` — 'ieee' overrides 'science' on conflicts.","message":"Combining styles with conflicting settings (e.g., two styles setting 'figure.facecolor') results in last style winning; order matters.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure your LaTeX distribution is complete, or use `'no-latex'` styles.","message":"Fonts may not appear as expected if the required LaTeX packages (like 'amsmath', 'sfmath') are missing; styles load them automatically.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Add `import scienceplots` at the top of your script.","cause":"You forgot `import scienceplots` before using `plt.style.use('science')`.","error":"AttributeError: module 'matplotlib.style' has no attribute 'use' (if import missing)"},{"fix":"Install scienceplots (`pip install scienceplots`) and `import scienceplots` in your script.","cause":"SciencePlots is not installed or styles not registered (often because `import scienceplots` is missing).","error":"FileNotFoundError: [Errno 2] No such file or directory: '.../styles/science.mplstyle'"},{"fix":"Use `plt.style.use(['science', 'no-latex'])` to disable LaTeX, or install a LaTeX distribution (e.g., TeX Live, MiKTeX).","cause":"The 'science' style tries to use LaTeX but LaTeX is not installed.","error":"RuntimeError: Failed to process string with tex because LaTeX is not installed or missing packages"},{"fix":"Verify style name (e.g., 'science', 'ieee') and ensure `import scienceplots` is executed.","cause":"Typo in style name or styles not registered (missing import).","error":"UserWarning: Style 'science' does not exist; falling back to default"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}