根据不同的需要,matplotlib可以设置不同的绘图风格,使用plt.style.available列出全部可用风格如下:
['Solarize_Light2', '_classic_test_patch', '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.show()前申明plt.style.use(‘bmh’)即可变换为对应的绘图风格。
下面的绘图风格都可以在matplotlib官方文档https://matplotlib.org/stable/gallery/style_sheets/style_sheets_reference.html中找到,为方便参考在这里列举一下。
如果是制图写论文,可以试一下下面的ggplot或者