首页 > 其他 > 详细

matplotlib 自带的几种美化样式

时间:2019-12-15 22:28:18      阅读:316      评论:0      收藏:0      [点我收藏+]

1、用 matplotlib.pyplot.style.avaliable 可查看 matplotlib 自带的美化样式如下:

[bmh,            classic,        dark_background,
 fast,             fivethirtyeight,   ggplot,
 grayscale,         seaborn-bright,    seaborn-colorblind,
 seaborn-dark-palette,  seaborn-dark,      seaborn-darkgrid,
 seaborn-deep,       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]

2、用如下的循环,可查看各种美化样式的效果

import numpy as np
import matplotlib.pyplot as plt

styles = plt.style.available

x = np.linspace(-10, 10)
y = np.sin(x)

for style in styles:
    plt.figure()
    plt.style.use(style)
    plt.plot(x, y)
    plt.title(style)
    plt.show()

技术分享图片

技术分享图片

技术分享图片

技术分享图片

技术分享图片

技术分享图片

技术分享图片

技术分享图片

 

 技术分享图片

matplotlib 自带的几种美化样式

原文:https://www.cnblogs.com/shanger/p/12046045.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!