Introduction to SciencePlots
SciencePlots is a project dedicated to enhancing the visual quality of scientific figures using Matplotlib styles. These styles are tailored for producing clear and professional figures suitable for scientific papers, presentations, and theses.
Project Overview
SciencePlots provides a collection of pre-defined styles that can be easily applied to Matplotlib figures. This opens up possibilities for scientists and researchers to create publication-ready plots with minimal effort, maintaining consistency in their visual presentations.
Installation and Getting Started
The installation of SciencePlots is straightforward. Users can install it via pip
or conda
:
pip install SciencePlots
conda install -c conda-forge scienceplots
For those who prefer the latest commit, it can be installed directly from GitHub:
pip install git+https://github.com/garrettj403/SciencePlots
Alternatively, users can clone the repository and install it locally:
git clone https://github.com/garrettj403/SciencePlots.git
cd SciencePlots
pip install -e .
From version v1.1.0
onwards, it is necessary to include import scienceplots
in scripts to activate the styles.
Using the Styles
SciencePlots features a principal style named "science"
. To utilize this style, include the following lines in your Python script:
import matplotlib.pyplot as plt
import scienceplots
plt.style.use('science')
Users can combine multiple styles to further customize the appearance. For example, combining "science"
with "ieee"
tailors the plot specifically for IEEE papers by adjusting font sizes and column widths:
plt.style.use(['science', 'ieee'])
To apply styles temporarily, a context manager can be used:
with plt.style.context('science'):
plt.figure()
plt.plot(x, y)
plt.show()
Examples and Use Cases
The project provides various examples demonstrating how the styles can be cascaded to fit different use cases. The primary "science"
style ensures readability and a clean layout, suitable for a wide range of academic and presentation purposes.
Specialized styles such as "science" + "ieee"
and "science" + "nature"
cater to the formatting requirements of IEEE and Nature publications, respectively.
Language and Font Support
SciencePlots supports multiple languages, including Chinese (Traditional and Simplified), Japanese, Korean, Russian, and Turkish. To use these languages, specific font installations might be required.
Color Cycles
The project also includes diverse color cycles, such as the color-blind safe "bright"
cycle and the attention-catching "high-vis"
cycle. These provide flexibility in thematic and accessibility-focused presentations.
Community and Contributions
The project encourages contributions from the community, welcoming new styles for various journals and additional color cycles. Users can engage through the GitHub issue tracker to suggest improvements or seek assistance.
SciencePlots is used by numerous academic publications, highlighting its utility and acceptance in the research community. Users of the project are encouraged to cite it, acknowledging its role in their visual presentation work.
By simplifying the process of generating scientifically accurate and visually appealing graphs, SciencePlots serves an essential role in scientific communication, ensuring that complex data is presented clearly and effectively.