├── .gitignore
├── LICENSE
├── MANIFEST.in
├── README.md
├── examples
├── figures
│ ├── fig1.jpg
│ ├── fig1.pdf
│ ├── fig10.jpg
│ ├── fig10.pdf
│ ├── fig11.jpg
│ ├── fig11.pdf
│ ├── fig2.jpg
│ ├── fig2.pdf
│ ├── fig3.jpg
│ ├── fig3.pdf
│ ├── fig4.jpg
│ ├── fig4.pdf
│ ├── fig5.jpg
│ ├── fig5.pdf
│ ├── fig6.jpg
│ ├── fig6.pdf
│ ├── fig7.jpg
│ ├── fig7.pdf
│ ├── fig8.jpg
│ ├── fig8.pdf
│ ├── fig9.jpg
│ └── fig9.pdf
└── plot-examples.py
├── setup.py
└── styles
├── color
├── bright.mplstyle
├── high-vis.mplstyle
├── muted.mplstyle
├── retro.mplstyle
└── vibrant.mplstyle
├── journals
└── ieee.mplstyle
├── misc
├── grid.mplstyle
├── no-latex.mplstyle
└── pgf.mplstyle
├── notebook.mplstyle
├── scatter.mplstyle
└── science.mplstyle
/.gitignore:
--------------------------------------------------------------------------------
1 | .ipynb_checkpoints/
2 | SciencePlots.egg-info/
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 John Garrett
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/MANIFEST.in:
--------------------------------------------------------------------------------
1 | global-include *.mplstyle
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Science Plots
2 | =============
3 |
4 | *Matplotlib styles for scientific plotting*
5 |
6 | This repo has Matplotlib styles to format your plots for scientific papers, presentations and theses.
7 |
8 |
9 |
10 | Installation
11 | ------------
12 |
13 | The easiest way to install SciencePlots is using ``pip``:
14 |
15 | ```bash
16 | # for latest version
17 | pip install git+https://github.com/garrettj403/SciencePlots.git
18 |
19 | # for last release
20 | pip install SciencePlots
21 | ```
22 |
23 | 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:
24 |
25 | ```python
26 | import matplotlib
27 | print(matplotlib.get_configdir())
28 | ```
29 |
30 | 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).
31 |
32 | Using the Styles
33 | ----------------
34 |
35 | ``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:
36 |
37 | ```python
38 | import matplotlib.pyplot as plt
39 |
40 | plt.style.use('science')
41 | ```
42 |
43 | You can also combine multiple styles together by:
44 |
45 | ```python
46 | plt.style.use(['science','ieee'])
47 | ```
48 |
49 | 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.).
50 |
51 | To use any of the styles temporarily, you can use:
52 |
53 | ```python
54 | with plt.style.context(['science', 'ieee']):
55 | plt.figure()
56 | plt.plot(x, y)
57 | plt.show()
58 | ```
59 |
60 | Examples
61 | --------
62 |
63 | The ``science`` style (the base style):
64 |
65 |
66 |
67 | The ``science`` + ``grid`` styles:
68 |
69 |
70 |
71 | The ``science`` + ``ieee`` styles for IEEE papers:
72 |
73 |
74 |
75 | 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.
76 |
77 | The ``science`` + ``scatter`` styles for scatter plots:
78 |
79 |
80 |
81 | The ``science`` + ``notebook`` styles for Jupyter notebooks:
82 |
83 |
84 |
85 | You can also combine these styles with the other styles that come with Matplotlib. For example, the ``dark_background`` + ``science`` + ``high-vis`` styles:
86 |
87 |
88 |
89 | **Note:** See the ``examples/`` directory for more!
90 |
91 | Color Cycles
92 | ------------
93 |
94 | The ``high-vis`` color cycle:
95 |
96 |
97 |
98 | The ``bright`` color cycle:
99 |
100 |
101 |
102 | The ``vibrant`` color cycle:
103 |
104 |
105 |
106 | The ``muted`` color cycle:
107 |
108 |
109 |
110 | The ``retro`` color cycle:
111 |
112 |
113 |
114 | **Note:** The ``bright``, ``vibrant`` and ``muted`` color cycles are from [Paul Tol's website](https://personal.sron.nl/~pault/). **They are color-blind safe!**
115 |
116 | Contribution
117 | ------------
118 |
119 | 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.
120 |
121 | You can checkout [Matplotlib's documentation](https://matplotlib.org/tutorials/introductory/customizing.html) for more plotting options.
122 |
123 | FAQ
124 | ---
125 |
126 | 1. Errors related to Latex:
127 |
128 | - The default ``science`` style 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 ``no-latex`` style:
129 |
130 | ```python
131 | plt.style.use(['science','no-latex'])
132 | ```
133 | - For Windows users, you may need to manually add Latex to your environment path ([see issue](https://github.com/garrettj403/SciencePlots/issues/9)).
134 |
135 | SciencePlots in Academic Papers
136 | -------------------------------
137 |
138 | The following papers use ``SciencePlots``:
139 |
140 | - J. Garrett, *et al.*, ["A Nonlinear Transmission Line Model for Simulating Distributed SIS Frequency Multipliers,"](https://ieeexplore.ieee.org/abstract/document/9050728) *IEEE Trans. THz Sci. Technol.*, vol. 10, no. 3, pp. 246-255, May 2020. ([open access](https://ora.ox.ac.uk/objects/uuid:5ca31c2c-a984-462c-b21a-3fe16eee0d9b/download_file?safe_filename=XXXX_final_JohnGarrett.pdf&type_of_work=Journal+article))
141 |
142 | - J. Garrett, *et al.*, ["Simulating the Behavior of a 230 GHz SIS Mixer Using Multi-Tone Spectral Domain Analysis,"](https://ieeexplore.ieee.org/document/8822760/) *IEEE Trans. THz Sci. Technol.*, vol. 9, no. 9, pp. 540-548, Nov. 2019. ([open access](https://ora.ox.ac.uk/objects/uuid:0fd4537d-258c-454a-bbfb-09b1bcd88d49/download_file?file_format=pdf&safe_filename=XXXX_final.pdf&type_of_work=Journal+article))
143 |
144 | - J. Garrett, *et al.*, ["A Compact and Easy to Fabricate E-plane Waveguide Bend,"](https://ieeexplore.ieee.org/document/8760521) *IEEE Microw. Wireless Compon. Lett.*, vol. 29, no. 8, pp. 529-531, Aug. 2019. ([open access](https://ora.ox.ac.uk/objects/uuid:496855f9-be2a-47cd-b498-1753d8033f50/download_file?file_format=pdf&safe_filename=Waveguide_Bend__IEEE_MWCL_.pdf&type_of_work=Journal+article))
145 |
146 | - J. Garrett, ["A 230 GHz Focal Plane Array Using a Wide IF Bandwidth SIS Receiver,"](https://ora.ox.ac.uk/objects/uuid:d47fbf3b-1cf3-4e58-be97-767b9893066e/download_file?file_format=pdf&safe_filename=GarrettJ_DPhilThesis.pdf&type_of_work=Thesis) DPhil thesis, University of Oxford, Oxford, UK, 2018. ([open access](https://ora.ox.ac.uk/objects/uuid:d47fbf3b-1cf3-4e58-be97-767b9893066e/download_file?file_format=pdf&safe_filename=GarrettJ_DPhilThesis.pdf&type_of_work=Thesis))
147 |
148 | If you use ``SciencePlots`` for your paper/thesis, feel free to add it to the list!
149 |
--------------------------------------------------------------------------------
/examples/figures/fig1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHNEWUAF/SciencePlots/33075e720472e295f0eccb3d7ef77ac9cea64dc1/examples/figures/fig1.jpg
--------------------------------------------------------------------------------
/examples/figures/fig1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHNEWUAF/SciencePlots/33075e720472e295f0eccb3d7ef77ac9cea64dc1/examples/figures/fig1.pdf
--------------------------------------------------------------------------------
/examples/figures/fig10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHNEWUAF/SciencePlots/33075e720472e295f0eccb3d7ef77ac9cea64dc1/examples/figures/fig10.jpg
--------------------------------------------------------------------------------
/examples/figures/fig10.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHNEWUAF/SciencePlots/33075e720472e295f0eccb3d7ef77ac9cea64dc1/examples/figures/fig10.pdf
--------------------------------------------------------------------------------
/examples/figures/fig11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHNEWUAF/SciencePlots/33075e720472e295f0eccb3d7ef77ac9cea64dc1/examples/figures/fig11.jpg
--------------------------------------------------------------------------------
/examples/figures/fig11.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHNEWUAF/SciencePlots/33075e720472e295f0eccb3d7ef77ac9cea64dc1/examples/figures/fig11.pdf
--------------------------------------------------------------------------------
/examples/figures/fig2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHNEWUAF/SciencePlots/33075e720472e295f0eccb3d7ef77ac9cea64dc1/examples/figures/fig2.jpg
--------------------------------------------------------------------------------
/examples/figures/fig2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHNEWUAF/SciencePlots/33075e720472e295f0eccb3d7ef77ac9cea64dc1/examples/figures/fig2.pdf
--------------------------------------------------------------------------------
/examples/figures/fig3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHNEWUAF/SciencePlots/33075e720472e295f0eccb3d7ef77ac9cea64dc1/examples/figures/fig3.jpg
--------------------------------------------------------------------------------
/examples/figures/fig3.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHNEWUAF/SciencePlots/33075e720472e295f0eccb3d7ef77ac9cea64dc1/examples/figures/fig3.pdf
--------------------------------------------------------------------------------
/examples/figures/fig4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHNEWUAF/SciencePlots/33075e720472e295f0eccb3d7ef77ac9cea64dc1/examples/figures/fig4.jpg
--------------------------------------------------------------------------------
/examples/figures/fig4.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHNEWUAF/SciencePlots/33075e720472e295f0eccb3d7ef77ac9cea64dc1/examples/figures/fig4.pdf
--------------------------------------------------------------------------------
/examples/figures/fig5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHNEWUAF/SciencePlots/33075e720472e295f0eccb3d7ef77ac9cea64dc1/examples/figures/fig5.jpg
--------------------------------------------------------------------------------
/examples/figures/fig5.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHNEWUAF/SciencePlots/33075e720472e295f0eccb3d7ef77ac9cea64dc1/examples/figures/fig5.pdf
--------------------------------------------------------------------------------
/examples/figures/fig6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHNEWUAF/SciencePlots/33075e720472e295f0eccb3d7ef77ac9cea64dc1/examples/figures/fig6.jpg
--------------------------------------------------------------------------------
/examples/figures/fig6.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHNEWUAF/SciencePlots/33075e720472e295f0eccb3d7ef77ac9cea64dc1/examples/figures/fig6.pdf
--------------------------------------------------------------------------------
/examples/figures/fig7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHNEWUAF/SciencePlots/33075e720472e295f0eccb3d7ef77ac9cea64dc1/examples/figures/fig7.jpg
--------------------------------------------------------------------------------
/examples/figures/fig7.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHNEWUAF/SciencePlots/33075e720472e295f0eccb3d7ef77ac9cea64dc1/examples/figures/fig7.pdf
--------------------------------------------------------------------------------
/examples/figures/fig8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHNEWUAF/SciencePlots/33075e720472e295f0eccb3d7ef77ac9cea64dc1/examples/figures/fig8.jpg
--------------------------------------------------------------------------------
/examples/figures/fig8.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHNEWUAF/SciencePlots/33075e720472e295f0eccb3d7ef77ac9cea64dc1/examples/figures/fig8.pdf
--------------------------------------------------------------------------------
/examples/figures/fig9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHNEWUAF/SciencePlots/33075e720472e295f0eccb3d7ef77ac9cea64dc1/examples/figures/fig9.jpg
--------------------------------------------------------------------------------
/examples/figures/fig9.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHNEWUAF/SciencePlots/33075e720472e295f0eccb3d7ef77ac9cea64dc1/examples/figures/fig9.pdf
--------------------------------------------------------------------------------
/examples/plot-examples.py:
--------------------------------------------------------------------------------
1 | """ An example of the 'science' theme. """
2 |
3 | import numpy as np
4 | import matplotlib.pyplot as plt
5 |
6 | def model(x, p):
7 | return x ** (2 * p + 1) / (1 + x ** (2 * p))
8 |
9 | x = np.linspace(0.75, 1.25, 201)
10 |
11 | with plt.style.context(['science']):
12 | fig, ax = plt.subplots()
13 | for p in [10, 15, 20, 30, 50, 100]:
14 | ax.plot(x, model(x, p), label=p)
15 | ax.legend(title='Order')
16 | ax.set(xlabel='Voltage (mV)')
17 | ax.set(ylabel='Current ($\mu$A)')
18 | ax.autoscale(tight=True)
19 | fig.savefig('figures/fig1.pdf')
20 | fig.savefig('figures/fig1.jpg', dpi=300)
21 |
22 | with plt.style.context(['science', 'ieee']):
23 | fig, ax = plt.subplots()
24 | for p in [10, 20, 50]:
25 | ax.plot(x, model(x, p), label=p)
26 | ax.legend(title='Order')
27 | ax.set(xlabel='Voltage (mV)')
28 | ax.set(ylabel='Current ($\mu$A)')
29 | ax.autoscale(tight=True)
30 | fig.savefig('figures/fig2.pdf')
31 | fig.savefig('figures/fig2.jpg', dpi=300)
32 |
33 | with plt.style.context(['science', 'scatter']):
34 | fig, ax = plt.subplots(figsize=(4,4))
35 | ax.plot([-2, 2], [-2, 2], 'k--')
36 | ax.fill_between([-2, 2], [-2.2, 1.8], [-1.8, 2.2], color='dodgerblue', alpha=0.2, lw=0)
37 | for i in range(7):
38 | x1 = np.random.normal(0, 0.5, 10)
39 | y1 = x1 + np.random.normal(0, 0.2, 10)
40 | ax.plot(x1, y1, label=r"$^\#${}".format(i+1))
41 | ax.legend(title='Sample', loc=2)
42 | ax.set_xlabel(r"$\log_{10}\left(\frac{L_\mathrm{IR}}{\mathrm{L}_\odot}\right)$")
43 | ax.set_ylabel(r"$\log_{10}\left(\frac{L_\mathrm{6.2}}{\mathrm{L}_\odot}\right)$")
44 | ax.set_xlim([-2, 2])
45 | ax.set_ylim([-2, 2])
46 | fig.savefig('figures/fig3.pdf')
47 | fig.savefig('figures/fig3.jpg', dpi=300)
48 |
49 | with plt.style.context(['science', 'high-vis']):
50 | fig, ax = plt.subplots()
51 | for p in [10, 15, 20, 30, 50, 100]:
52 | ax.plot(x, model(x, p), label=p)
53 | ax.legend(title='Order')
54 | ax.set(xlabel='Voltage (mV)')
55 | ax.set(ylabel='Current ($\mu$A)')
56 | ax.autoscale(tight=True)
57 | fig.savefig('figures/fig4.pdf')
58 | fig.savefig('figures/fig4.jpg', dpi=300)
59 |
60 | with plt.style.context(['dark_background', 'science', 'high-vis']):
61 | fig, ax = plt.subplots()
62 | for p in [10, 15, 20, 30, 50, 100]:
63 | ax.plot(x, model(x, p), label=p)
64 | ax.legend(title='Order')
65 | ax.set(xlabel='Voltage (mV)')
66 | ax.set(ylabel='Current ($\mu$A)')
67 | ax.autoscale(tight=True)
68 | fig.savefig('figures/fig5.pdf')
69 | fig.savefig('figures/fig5.jpg', dpi=300)
70 |
71 | with plt.style.context(['science', 'notebook']):
72 | fig, ax = plt.subplots()
73 | for p in [10, 15, 20, 30, 50, 100]:
74 | ax.plot(x, model(x, p), label=p)
75 | ax.legend(title='Order')
76 | ax.set(xlabel='Voltage (mV)')
77 | ax.set(ylabel='Current ($\mu$A)')
78 | ax.autoscale(tight=True)
79 | fig.savefig('figures/fig10.pdf')
80 | fig.savefig('figures/fig10.jpg', dpi=300)
81 |
82 | # Plot different color cycles
83 |
84 | with plt.style.context(['science', 'bright']):
85 | fig, ax = plt.subplots()
86 | for p in [5, 10, 15, 20, 30, 50, 100]:
87 | ax.plot(x, model(x, p), label=p)
88 | ax.legend(title='Order')
89 | ax.set(xlabel='Voltage (mV)')
90 | ax.set(ylabel='Current ($\mu$A)')
91 | ax.autoscale(tight=True)
92 | fig.savefig('figures/fig6.pdf')
93 | fig.savefig('figures/fig6.jpg', dpi=300)
94 |
95 | with plt.style.context(['science', 'vibrant']):
96 | fig, ax = plt.subplots()
97 | for p in [5, 10, 15, 20, 30, 50, 100]:
98 | ax.plot(x, model(x, p), label=p)
99 | ax.legend(title='Order')
100 | ax.set(xlabel='Voltage (mV)')
101 | ax.set(ylabel='Current ($\mu$A)')
102 | ax.autoscale(tight=True)
103 | fig.savefig('figures/fig7.pdf')
104 | fig.savefig('figures/fig7.jpg', dpi=300)
105 |
106 | with plt.style.context(['science', 'muted']):
107 | fig, ax = plt.subplots()
108 | for p in [5, 7, 10, 15, 20, 30, 38, 50, 100, 500]:
109 | ax.plot(x, model(x, p), label=p)
110 | ax.legend(title='Order', fontsize=7)
111 | ax.set(xlabel='Voltage (mV)')
112 | ax.set(ylabel='Current ($\mu$A)')
113 | ax.autoscale(tight=True)
114 | fig.savefig('figures/fig8.pdf')
115 | fig.savefig('figures/fig8.jpg', dpi=300)
116 |
117 | with plt.style.context(['science', 'retro']):
118 | fig, ax = plt.subplots()
119 | for p in [10, 15, 20, 30, 50, 100]:
120 | ax.plot(x, model(x, p), label=p)
121 | ax.legend(title='Order')
122 | ax.set(xlabel='Voltage (mV)')
123 | ax.set(ylabel='Current ($\mu$A)')
124 | ax.autoscale(tight=True)
125 | fig.savefig('figures/fig9.pdf')
126 | fig.savefig('figures/fig9.jpg', dpi=300)
127 |
128 | with plt.style.context(['science', 'grid']):
129 | fig, ax = plt.subplots()
130 | for p in [10, 15, 20, 30, 50, 100]:
131 | ax.plot(x, model(x, p), label=p)
132 | ax.legend(title='Order')
133 | ax.set(xlabel='Voltage (mV)')
134 | ax.set(ylabel='Current ($\mu$A)')
135 | ax.autoscale(tight=True)
136 | fig.savefig('figures/fig11.pdf')
137 | fig.savefig('figures/fig11.jpg', dpi=300)
138 |
--------------------------------------------------------------------------------
/setup.py:
--------------------------------------------------------------------------------
1 | """Install SciencePlots.
2 |
3 | This will copy the *.mplstyle files into the appropriate directory.
4 |
5 | This code is based on a StackOverflow answer:
6 | https://stackoverflow.com/questions/31559225/how-to-ship-or-distribute-a-matplotlib-stylesheet
7 |
8 | """
9 |
10 | import atexit
11 | import glob
12 | import os
13 | import shutil
14 |
15 | import matplotlib
16 | from setuptools import setup
17 | from setuptools.command.install import install
18 |
19 |
20 | # Get description from README
21 | root = os.path.abspath(os.path.dirname(__file__))
22 | with open(os.path.join(root, 'README.md'), 'r', encoding='utf-8') as f:
23 | long_description = f.read()
24 |
25 | def install_styles():
26 |
27 | # Find all style files
28 | stylefiles = glob.glob('styles/**/*.mplstyle', recursive=True)
29 |
30 | # Find stylelib directory (where the *.mplstyle files go)
31 | mpl_stylelib_dir = os.path.join(matplotlib.get_configdir() ,"stylelib")
32 | if not os.path.exists(mpl_stylelib_dir):
33 | os.makedirs(mpl_stylelib_dir)
34 |
35 | # Copy files over
36 | print("Installing styles into", mpl_stylelib_dir)
37 | for stylefile in stylefiles:
38 | print(os.path.basename(stylefile))
39 | shutil.copy(
40 | stylefile,
41 | os.path.join(mpl_stylelib_dir, os.path.basename(stylefile)))
42 |
43 | class PostInstallMoveFile(install):
44 | def __init__(self, *args, **kwargs):
45 | super().__init__(*args, **kwargs)
46 | atexit.register(install_styles)
47 |
48 | setup(
49 | name='SciencePlots',
50 | version='1.0.3',
51 | author="John Garrett",
52 | author_email="garrettj403@gmail.com",
53 | description="Format Matplotlib for scientific plotting",
54 | long_description=long_description,
55 | long_description_content_type='text/markdown',
56 | license="MIT",
57 | keywords=[
58 | "matplotlib-style-sheets",
59 | "matplotlib-figures",
60 | "scientific-papers",
61 | "thesis-template",
62 | "matplotlib-styles",
63 | "python"
64 | ],
65 | url="https://github.com/garrettj403/SciencePlots/",
66 | install_requires=['matplotlib',],
67 | cmdclass={'install': PostInstallMoveFile,},
68 | )
69 |
--------------------------------------------------------------------------------
/styles/color/bright.mplstyle:
--------------------------------------------------------------------------------
1 | # Bright color scheme
2 | # color-blind safe
3 | # from Paul Tot's website: https://personal.sron.nl/~pault/
4 |
5 | # Set color cycle
6 | axes.prop_cycle : cycler('color', ['4477AA', '66CCEE', '228833', 'CCBB44', 'EE6677', 'AA3377', 'BBBBBB'])
7 |
--------------------------------------------------------------------------------
/styles/color/high-vis.mplstyle:
--------------------------------------------------------------------------------
1 | # Matplotlib style for high visability plots (i.e., bright colors!!!)
2 |
3 | # Set color cycle
4 | axes.prop_cycle : (cycler('color', ["0d49fb", "e6091c", "26eb47", "8936df", "fec32d", "25d7fd"]) + cycler('ls', ['-', '--', '-.', ':', '-', '--']))
5 |
--------------------------------------------------------------------------------
/styles/color/muted.mplstyle:
--------------------------------------------------------------------------------
1 | # Muted color scheme
2 | # color-blind safe
3 | # from Paul Tot's website: https://personal.sron.nl/~pault/
4 |
5 | # Set color cycle
6 | axes.prop_cycle : cycler('color', ['332288', '88CCEE', '44AA99', '117733', '999933', 'DDCC77', 'CC6677', '882255', 'AA4499', 'DDDDDD'])
7 |
--------------------------------------------------------------------------------
/styles/color/retro.mplstyle:
--------------------------------------------------------------------------------
1 | # Retro color style
2 |
3 | # Set color cycle
4 | axes.prop_cycle : cycler('color', ['4165c0', 'e770a2', '5ac3be', '696969', 'f79a1e', 'ba7dcd'])
5 |
--------------------------------------------------------------------------------
/styles/color/vibrant.mplstyle:
--------------------------------------------------------------------------------
1 | # Vibrant color scheme
2 | # color-blind safe
3 | # from Paul Tot's website: https://personal.sron.nl/~pault/
4 |
5 | # Set color cycle
6 | axes.prop_cycle : cycler('color', ['0077BB', '33BBEE', '009988', 'EE7733', 'CC3311', 'EE3377', 'BBBBBB'])
7 |
--------------------------------------------------------------------------------
/styles/journals/ieee.mplstyle:
--------------------------------------------------------------------------------
1 | # Matplotlib style for IEEE plots
2 | # This style should work for most two-column journals
3 |
4 | # Set color cycle
5 | # Set line style as well for black and white graphs
6 | axes.prop_cycle : (cycler('color', ['k', 'r', 'b', 'g']) + cycler('ls', ['-', '--', ':', '-.']))
7 |
8 | # Set default figure size
9 | figure.figsize : 3.3, 2.5
10 | figure.dpi : 600
11 |
12 | # Font sizes
13 | font.size : 8
14 |
--------------------------------------------------------------------------------
/styles/misc/grid.mplstyle:
--------------------------------------------------------------------------------
1 | # Add grid lines and turn the legend frame on
2 |
3 | # Grid lines
4 | axes.grid : True
5 | grid.linestyle : :
6 | grid.color : k
7 | grid.alpha : 0.5
8 | grid.linewidth : 0.5
9 |
10 | # Legend
11 | legend.frameon : True
12 | legend.framealpha : 1.0
13 | legend.fancybox : True
14 | legend.numpoints : 1
15 |
--------------------------------------------------------------------------------
/styles/misc/no-latex.mplstyle:
--------------------------------------------------------------------------------
1 | # Deactivate LaTeX
2 |
3 | text.usetex : False
4 |
--------------------------------------------------------------------------------
/styles/misc/pgf.mplstyle:
--------------------------------------------------------------------------------
1 | # Add LaTeX package to allow PGF plots
2 |
3 | text.latex.preamble : \usepackage{amsmath}, \usepackage[T1]{fontenc}, \usepackage{pgfplots}
4 |
--------------------------------------------------------------------------------
/styles/notebook.mplstyle:
--------------------------------------------------------------------------------
1 | # Matplotlib style for Jupyter notebooks
2 |
3 | # Set default figure size
4 | figure.figsize : 8, 6
5 |
6 | # Set x axis
7 | xtick.major.size : 6
8 | xtick.major.width : 1
9 | xtick.minor.size : 3
10 | xtick.minor.width : 1
11 |
12 | # Set y axis
13 | ytick.major.size : 6
14 | ytick.major.width : 1
15 | ytick.minor.size : 3
16 | ytick.minor.width : 1
17 |
18 | # Fontsizes
19 | xtick.labelsize : 16
20 | ytick.labelsize : 16
21 | legend.fontsize : 16
22 | legend.title_fontsize : 16
23 | axes.titlesize : 16
24 | axes.labelsize : 16
25 |
26 | # Set line widths
27 | axes.linewidth : 1
28 | grid.linewidth : 1
29 | lines.linewidth : 2.
30 |
31 | # Use sans-serif fonts
32 | font.family : sans-serif
33 |
34 | # Use LaTeX for math formatting
35 | text.usetex : False
36 |
--------------------------------------------------------------------------------
/styles/scatter.mplstyle:
--------------------------------------------------------------------------------
1 | # Matplotlib style for scatter plots
2 |
3 | # Set markers (style, color, no lines)
4 | axes.prop_cycle : (cycler('marker', ['o', 's', '^', 'v', '<', '>', 'd']) + cycler('color', ['0C5DA5', '00B945', 'FF9500', 'FF2C00', '845B97', '474747', '9e9e9e']) + cycler('ls', [' ', ' ', ' ', ' ', ' ', ' ', ' ']))
5 |
6 | # Set marker size
7 | lines.markersize : 3
8 |
--------------------------------------------------------------------------------
/styles/science.mplstyle:
--------------------------------------------------------------------------------
1 | # Matplotlib style for scientific plotting
2 | # This is the base style for "SciencePlots"
3 | # see: https://github.com/garrettj403/SciencePlots
4 |
5 | # Set color cycle: blue, green, yellow, red, violet, gray
6 | axes.prop_cycle : cycler('color', ['0C5DA5', '00B945', 'FF9500', 'FF2C00', '845B97', '474747', '9e9e9e'])
7 |
8 | # Set default figure size
9 | figure.figsize : 3.5, 2.625
10 |
11 | # Set x axis
12 | xtick.direction : in
13 | xtick.major.size : 3
14 | xtick.major.width : 0.5
15 | xtick.minor.size : 1.5
16 | xtick.minor.width : 0.5
17 | xtick.minor.visible : True
18 | xtick.top : True
19 |
20 | # Set y axis
21 | ytick.direction : in
22 | ytick.major.size : 3
23 | ytick.major.width : 0.5
24 | ytick.minor.size : 1.5
25 | ytick.minor.width : 0.5
26 | ytick.minor.visible : True
27 | ytick.right : True
28 |
29 | # Set line widths
30 | axes.linewidth : 0.5
31 | grid.linewidth : 0.5
32 | lines.linewidth : 1.
33 |
34 | # Remove legend frame
35 | legend.frameon : False
36 |
37 | # Always save as 'tight'
38 | savefig.bbox : tight
39 | savefig.pad_inches : 0.05
40 |
41 | # Use serif fonts
42 | font.serif : Times New Roman
43 | font.family : serif
44 | mathtext.fontset : dejavuserif
45 |
46 | # Use LaTeX for math formatting
47 | text.usetex : True
48 | text.latex.preamble : \usepackage{amsmath}
49 |
--------------------------------------------------------------------------------