{"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,"search_vec":"'2.2.1':38 '3.8':50 'cadenc':44 'color':24 'contrast':23 'current':35 'cycl':25 'etc':19 'everi':45 'explicit':29 'high':22 'high-contrast':21 'ieee':17 'import':30 'journal':15 'latex':57 'match':14 'matplotlib':4,51 'month':47 'natur':18 'offer':10 'plot':12,54 'preconfigur':11 'provid':3 'public':9,56 'python':49 'relat':41 'releas':43 'requir':16,27,48 'scienc':53 'science-plot':52 'scienceplot':1,2,31 'scientif':8 'sheet':6 'sinc':33 'slow':42 'statement':32 'style':5 'stylesheet':55 'v1.1.0':34 'version':36","created_at":"2026-05-01T08:13:43.676299+00:00","updated_at":"2026-05-01T08:13:43.676299+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.2.1","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/garrettj403/SciencePlots","docs":"https://github.com/garrettj403/SciencePlots/wiki","changelog":"https://github.com/garrettj403/SciencePlots/blob/master/CHANGES.md","pypi":"https://pypi.org/project/scienceplots/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}