Matplotlib styles for scientific plotting
This repo has Matplotlib styles to format your plots for scientific papers, presentations and theses.
The easiest way to install SciencePlots is using
# for latest version pip install git+https://github.com/garrettj403/SciencePlots.git # for last release pip install SciencePlots
The pip installation will automatically move all of the
*.mplstyle files into the appropriate directory. You
can also do this manually, if you like. First, clone the repository
and then copy all of the
*.mplstyle files into your
Matplotlib style directory. If you're not sure where this is, in an
interactive python console type:
import matplotlib print(matplotlib.get_configdir())
You should get back something like
/home/garrett/.matplotlib. You would then put the
*.mplstyle files in
/home/garrett/.matplotlib/stylelib/ (you may need to
Using the Styles
science.mplstyle is the main style from this repo.
Whenever you want to use it, simply add the following to the top of
your python script:
import matplotlib.pyplot as plt plt.style.use('science')
You can also combine multiple styles together by:
In this case, the
ieee style will override some of
the parameters from the main
science style in order to
configure the plot for IEEE papers (column width, fontsizes,
To use any of the styles temporarily, you can use:
with plt.style.context(['science', 'ieee']): plt.figure() plt.plot(x, y) plt.show()
science style (the base style):
ieee styles for IEEE
IEEE requires figures to be readable when printed in black and
ieee style also sets the figure width to
fit within one column of an IEEE paper.
scatter styles for
notebook styles for
You can also combine these styles with the other styles that
come with Matplotlib. For example, the
Note: See the
high-vis color cycle:
bright color cycle:
vibrant color cycle:
muted color cycle:
retro color cycle:
muted color cycles are from
Tol's website. They are color-blind safe!
Please feel free to add to this repo! For example, it would be good to add styles for different journals or perhaps new color cycles.
You can checkout Matplotlib's documentation for more plotting options.
Errors related to Latex:
sciencestyle uses Latex font rendering. If you do not have Latex on your computer or if you think that Latex takes too long, you can disable Latex using the
- For Windows users, you may need to manually add Latex to your environment path (see issue).
SciencePlots in Academic Papers
The following papers use
J. Garrett, et al., "A Nonlinear Transmission Line Model for Simulating Distributed SIS Frequency Multipliers," IEEE Trans. THz Sci. Technol., vol. 10, no. 3, pp. 246-255, May 2020. (open access)
J. Garrett, et al., "Simulating the Behavior of a 230 GHz SIS Mixer Using Multi-Tone Spectral Domain Analysis," IEEE Trans. THz Sci. Technol., vol. 9, no. 9, pp. 540-548, Nov. 2019. (open access)
J. Garrett, et al., "A Compact and Easy to Fabricate E-plane Waveguide Bend," IEEE Microw. Wireless Compon. Lett., vol. 29, no. 8, pp. 529-531, Aug. 2019. (open access)
J. Garrett, "A 230 GHz Focal Plane Array Using a Wide IF Bandwidth SIS Receiver," DPhil thesis, University of Oxford, Oxford, UK, 2018. (open access)
If you use
SciencePlots for your paper/thesis, feel
free to add it to the list!