Skip to content

Using the Styles

Echedey Luis edited this page Nov 7, 2022 · 2 revisions

"science" 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
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', 'ieee']):
    plt.figure()
    plt.plot(x, y)
    plt.show()