Skip to main content

Science Plots

PyPI version PyPI version
conda-forge version conda-forge version
DOI 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:

# 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:

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:

import matplotlib.pyplot as plt
import scienceplots

plt.style.use('science')

You can also combine multiple styles together by:

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:

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 supports:

Example: Traditional Chinese (science + no-latex + cjk-tc-font):

See the FAQ for information on installing CJK fonts.

Other color cycles

SciencePlots comes with a variety of different color cycles. For a full list, see the project Wiki. Two examples are shown below.

The bright color cycle (color blind safe):

The high-vis color cycle:

Paul Tol's discrete rainbow color sets are available as well, with the style identifier discrete-rainbow-<n>, where <n> is the number of unique colors. <n> ranges from 1 to 23 (inclusive). For example, discrete-rainbow-15:

Help and Contributing

Please feel free to contribute to the SciencePlots repo! For example, it would be good to add new styles for different journals and add new color cycles. Before starting a new style or making any changes, please create an issue through the GitHub issue tracker. That way we can discuss if the changes are necessary and the best approach.

If you need any help with SciencePlots, please first check the FAQ and search through the previous GitHub issues. If you can't find an answer, create a new issue through the GitHub issue tracker.

You can checkout Matplotlib's documentation for more information on plotting settings.

FAQ

You can find the FAQ in the project Wiki.

SciencePlots in Academic Papers

The following papers use SciencePlots:

If you use SciencePlots in your paper/thesis, feel free to add it to the list!

Citing SciencePlots

You don't have to cite SciencePlots if you use it but it's nice if you do:

@article{SciencePlots,
  author       = {John D. Garrett},
  title        = {{garrettj403/SciencePlots}},
  month        = sep,
  year         = 2021,
  publisher    = {Zenodo},
  version      = {1.0.9},
  doi          = {10.5281/zenodo.4106649},
  url          = {http://doi.org/10.5281/zenodo.4106649}
}

Release files for SciencePlots 2.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for SciencePlots 2.2.2
File Size Uploaded
scienceplots-2.2.2.tar.gz 19.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for SciencePlots 2.2.2
File Interpreter ABI Platform
scienceplots-2.2.2-py3-none-any.whl Python 3 none any Details

Total release size:53.1 kB

Release files / scienceplots-2.2.2.tar.gz

Download URL scienceplots-2.2.2.tar.gz
Size 19.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d46ce7170b4160265c777a48f73a0db1fdff8460f59a0ded0e364acb139ab115
BLAKE2b-256 checksum
How to use checksums
500573a19270d548caadf145b0fc8ab94a8c716faeca528c254a4192676e048b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / scienceplots-2.2.2-py3-none-any.whl

Download URL scienceplots-2.2.2-py3-none-any.whl
Size 33.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f63d04e6ec11fe2036ec120feb6c2f1d84b7c38e96cc7edcde7208064653af98
BLAKE2b-256 checksum
How to use checksums
5dff6469a5cabf230ebc94f927246874136098dde1aacc9328bc40dceb24ba13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release history Release notifications | RSS feed

This release

2.2.2 This release

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.9

1 release file

1.0.8

1 release file

1.0.7

1 release file

1.0.6

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page