内置样式
# 全部内置样式
from matplotlib import style
print(plt.style.available)
‘bmh’, ‘classic’, ‘dark_background’, ‘fast’, ‘fivethirtyeight’, ‘ggplot’, ‘grayscale’, ‘seaborn-bright’, ‘seaborn-muted’, ‘seaborn-notebook’, ‘seaborn-paper’, ‘seaborn-pastel’, ‘seaborn-poster’, ‘seaborn-talk’, ‘seaborn-ticks’, ‘seaborn-white’, ‘seaborn-whitegrid’, ‘seaborn’, ‘Solarize_Light2’, ‘tableau-colorblind10’, ‘_classic_test’
使用方法:
plt.style.use('bmh')
这里的背景有格线是因为我用了
plt.grid(True, linestyle='-.')
以下是我尝试了每一种内置格式,可以根据自己的需求选择合适的:
(1)bmh
(2)classic
(3)dark_background
(4)fast
(5)fivethirtyeight
(6)ggplot
(7) ‘grayscale’
(8)‘seaborn-bright’
(9) seaborn-muted
(10) seaborn-notebook
(11) seaborn-paper
(12)seaborn-pastel
(13) seaborn-poster