Skip to main content

Science Plots

Format Matplotlib for scientific plotting

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

Installation

The easiest way to install SciencePlots is using pip:

python -m pip install git+https://github.com/garrettj403/SciencePlots.git

This will 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 create the stylelib directory).

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:

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

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, etc.).

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

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

Contribution

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.

Examples

The science style:

The science + ieee styles:

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 + scatter styles:

You can also combine these styles with the other styles that come with Matplotlib. For example, the dark_background + science + high-vis styles:

Note: See the examples/ directory for more!

Color Cycles

The high-vis color cycle:

The bright color cycle:

The vibrant color cycle:

The muted color cycle:

The retro color cycle:

Note: The bright, vibrant and muted styles are from Paul Tol's website (https://personal.sron.nl/~pault/). They are color-blind safe!

SciencePlots in Academic Papers

The following papers use SciencePlots:

Feel free to add your paper to the list if you use SciencePlots!

Metadata

Release files for SciencePlots 1.0.0

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 1.0.0
File Size Uploaded Provenance Actions
SciencePlots-1.0.0.tar.gz 3.7 kB Without provenance Details for SciencePlots-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 7.5 kB

Release files / SciencePlots-1.0.0.tar.gz

Download URL SciencePlots-1.0.0.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
33f0330899fc446fd55558cadea707c52f03ae029b0ea03f8a82e016924b158b
BLAKE2b-256 checksum
How to use checksums
015c0c6c9b6f39c4fe0fb31d05b0c22366d83e4002572dfc9c2839edd168ac3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.0

Release files / SciencePlots-1.0.0-py3-none-any.whl

Download URL SciencePlots-1.0.0-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54e19e2d26f6bf321fe206bb7b363626d71f0fcf52fa8a3b067aec371c2226de
BLAKE2b-256 checksum
How to use checksums
dc7e4b12d3c98257d5a50369323670a17a51aec27b46c9fb512780ed16c9f509
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.0

Security for SciencePlots 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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