风格设置
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
查看能使用哪些风格
plt.style.available
['Solarize_Light2',
'_classic_test_patch',
'_mpl-gallery',
'_mpl-gallery-nogrid',
'bmh',
'classic',
'dark_background',
'fast',
'fivethirtyeight',
'ggplot',
'grayscale',
'seaborn',
'seaborn-bright',
'seaborn-colorblind',
'seaborn-dark',
'seaborn-dark-palette',
'seaborn-darkgrid',
'seaborn-deep',
'seaborn-muted',
'seaborn-notebook',
'seaborn-paper',
'seaborn-pastel',
'seaborn-poster',
'seaborn-talk',
'seaborn-ticks',
'seaborn-white',
'seaborn-whitegrid',
'tableau-colorblind10']
x = np.linspace(-5, 5)
y = np.sin(x)
设置风格
plt.style.use('dark_background')
plt.plot(x, y)
也可以混合使用 不过不推荐
plt.style.use(['dark_background', 'ggplot'])
plt.plot(x, y)