About this project
SciencePlots is an open-source Python library that provides a collection of Matplotlib styles designed for formatting scientific figures for papers, presentations, and theses. The primary style, 'science', can be applied with a single line of code and cascaded with additional styles to fine-tune appearance for specific venues.
Installation is straightforward via pip (pip install SciencePlots) or conda (conda install -c conda-forge scienceplots). From version 1.1.0 onward, users must add 'import scienceplots' at the top of their scripts before calling plt.style.use(). The library requires LaTeX for rendering mathematical expressions, and CJK fonts must be installed separately for Chinese, Japanese, Korean, and other non-Latin scripts.
Key features include:
- Journal-specific styles: Combine 'science' with 'ieee' for IEEE papers (sets column width, ensures black-and-white readability) or 'nature' for Nature articles (sans-serif fonts).
- Color cycles: Multiple color palettes including 'bright' (color-blind safe), 'high-vis', and Paul Tol's discrete rainbow sets (discrete-rainbow-1 through discrete-rainbow-23).
- CJK language support: Styles for Traditional Chinese, Simplified Chinese, Japanese, Korean, Russian, and Turkish, with a 'no-latex' variant for environments without LaTeX.
- Temporary style application: Use plt.style.context('science') to apply styles within a block without affecting the rest of the script.
- Style cascading: Multiple styles can be combined (e.g., plt.style.use(['science','ieee'])) where later styles override earlier parameters.
The project includes a gallery of example figures on its GitHub Wiki, a FAQ for troubleshooting, and a list of academic papers that have used SciencePlots. The library is actively maintained, with contributions welcome for new journal styles and color cycles. It is published on PyPI and conda-forge, and has a DOI via Zenodo for citation purposes.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.