garrettj403 /SciencePlots

Matplotlib styles for scientific plotting

★ 9,370⑂ 823👁 64⑃ 49● 103▤ 14
PythonCreated 2018-08-14
9,370
stars
+0+7+86
823
forks
64
watchers
49
prs
103
issues
14
releases
–
discussions

README

Science Plots
=============


    
        
            PyPI version
            
                
                    
                
            
        
        
            conda-forge version
            
                
                    
                
            
        
        
            DOI
            
                
                    
                
            
        
    


 Warning
 : As of version 2.0.0, you need to add import scienceplots before setting the style (plt.style.use('science')).

Matplotlib styles for scientific figures

This repo has Matplotlib styles to format your figures for scientific papers, presentations and theses.





You can find the full gallery of included styles here.

Getting Started
---------------

The easiest way to install SciencePlots is by using pip:

bash
 to install the latest release (from PyPI)
pip install SciencePlots

 to install the latest release (using Conda)
conda install -c conda-forge scienceplots

 to install the latest commit (from GitHub)
pip install git+https://github.com/garrettj403/SciencePlots

 to clone and install from a local copy
git clone https://github.com/garrettj403/SciencePlots.git
cd SciencePlots
pip install -e .


From version v1.1.0 on, import scienceplots is needed on top of your scripts so Matplotlib can make use of the styles.

Notes: 
- SciencePlots requires Latex (see Latex installation instructions). 
- If you would like to use CJK fonts, you will need to install these font separately (see CJK font installation instructions).

Please see the FAQ for more information and troubleshooting.

Using the Styles
----------------

"science" is the primary style in this repo. Whenever you want to use it, simply add the following to the top of your python script:

python
import matplotlib.pyplot as plt
import scienceplots

plt.style.use('science')


You can also combine multiple styles together by:

python
plt.style.use(['science','ieee'])


In this case, the ieee style will override some of the parameters from the science style in order to configure the plot for IEEE papers (column width, fontsizes, etc.).

To use any of the styles temporarily, you can use:

python
with plt.style.context('science'):
    plt.figure()
    plt.plot(x, y)
    plt.show()


Examples
--------

The basic science style is shown below:



It can be cascaded with other styles to fine-tune the appearance. For example, the science + notebook styles (intended for Jupyter notebooks):



Please see the project Wiki for a full list of available styles.

Specific Styles for Academic Journals
-------------------------------------

The science + ieee styles for IEEE papers:



   - IEEE requires figures to be readable when printed in black and white. The ieee style also sets the figure width to fit within one column of an IEEE paper.

The science + nature styles for Nature articles:



   - Nature recommends sans-serif fonts.

Other languages
---------------

SciencePlots currently supp

Snapshot: 2026-11-04T14:00:00Z · Data license Apache-2.0 · JSON