关于matplotlib的绘图风格

在使用matplotlib.pyplot时,可以更换绘图的风格,以便展示的图更加的美观

>>> print(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']

可以根据喜好挑一种使用即可,在导入plt之后添加以下语句即可:

plt.style.use('fivethirtyeight')

你可能感兴趣的:(Python,matplotlib,python)