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())
In [5]:
print(plt.style.available)
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()