A collection of matplotlib style files compatible with various scientific journals.
Use install.py
to make a copy of the style files. There are a few installation
options:
- Detect and install all styles to the shared matplotlib configuration directory:
python3 install.py
- Install to a specific directory (e.g., a project)
python3 install.py -o ~/myproject/styles
Use the -j
option to limit the journal styles that are installed. One or more
of the following values can be specified:
acs
: American Chemical Society (ACS) journalsaip
: American Institute of Physics (AIP) journals
The default value is all
, which will install all of the above.
To uninstall, simply remove the files that you installed. This is easier in a project than in the configuration directory!
For best results, you should make sure to install the Microsoft fonts.
The following styles may exist (but are not required) for each <journal>
:
<journal>
: default one-panel figure<journal>-tall
: one-column two-panel figure<journal>-wide
: two-column figure
To use a style in your plot, load it at the top of your script. You should always
load the mphowardlab
style first, followed by any options for a particular journal.
Example for a one-panel AIP figure with styles installed in shared directory:
import matplotlib.pyplot as plt
plt.style.use(['mphowardlab','aip'])
Example for a one-panel AIP figure with styles installed in a project:
import matplotlib.pyplot as plt
plt.style.use(['./mphowardlab.mplstyle','./aip.mplstyle'])
The default color cyle implements the following colors that may be manually specified in plot commands:
C0
: redC1
: blueC2
: greenC3
: orangeC4
: purpleC5
: pinkC6
: goldC7
: greyC8
: black
New journal styles can be added to this collection using the following steps:
- Choose a journal name prefix that is not already taken.
- Create as many style files as you want, always including the prefix and following the naming conventions listed above.
- Add this prefix to the list of choices in
install.py
.
For detailed style file options, see this tutorial with an example
matplotlibrc
file.