zoukankan      html  css  js  c++  java
  • matplotlib 自带的几种美化样式

    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()

     

     

  • 相关阅读:
    java实现HTTP请求 HttpUtil
    java-websocket客户端 断线重连 注入Service问题
    人工智能博客
    git 修改注释
    2019-2-22
    2019-2-21
    2019-2-20
    /与./和../的含义
    第二章(构建有多个房间的聊天室程序)
    第一章(欢迎进入node.js世界)
  • 原文地址:https://www.cnblogs.com/shanger/p/12046045.html
Copyright © 2011-2022 走看看