In [1]:
%matplotlib inline

In [2]:
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np

In [3]:
# print(mpl.get_configdir())

In [4]:
print(mpl.matplotlib_fname())


/usr/local/lib/python3.6/site-packages/matplotlib/mpl-data/matplotlibrc

In [5]:
print(plt.style.available)


['seaborn-dark', 'seaborn-darkgrid', 'seaborn-ticks', 'fivethirtyeight', 'seaborn-whitegrid', 'classic', 'seaborn-talk', 'seaborn-dark-palette', 'seaborn-bright', 'seaborn-pastel', 'grayscale', 'seaborn-notebook', 'ggplot', 'seaborn-colorblind', 'seaborn-muted', 'seaborn', 'seaborn-paper', 'bmh', 'seaborn-white', 'dark_background', 'seaborn-poster', 'seaborn-deep']

In [6]:
x = np.arange(0, 2 * np.pi, 0.1)
y = np.sin(x)

In [7]:
plt.plot(x, y)
plt.savefig('data/dst/matplotlib_style_default.png')
plt.show()



In [8]:
with plt.style.context('dark_background'):
    plt.plot(x, y)
    plt.savefig('data/dst/matplotlib_style_dark_background.png')
    plt.show()



In [9]:
with plt.style.context(['ggplot', 'dark_background']):
    plt.plot(x, y)
    plt.savefig('data/dst/matplotlib_style_ggplot_dark_background.png')
    plt.show()



In [10]:
with plt.style.context('data/src/test.mplstyle'):
    plt.plot(x, y)
    plt.savefig('data/dst/matplotlib_style_test.png')
    plt.show()



In [11]:
with plt.style.context(['ggplot', 'data/src/test.mplstyle']):
    plt.plot(x, y)
    plt.savefig('data/dst/matplotlib_style_test_ggplot.png')
    plt.show()



In [12]:
plt.style.use('ggplot')
plt.plot(x, y)
plt.savefig('data/dst/matplotlib_style_ggplot.png')
plt.show()