• Seaborn基础2


    import matplotlib.pyplot as plt
    import seaborn as sns
    import numpy as np
    
    def sinplot(flip = 1):
        x = np.linspace(0,14,100)
        for i in range(1,7):
            plt.plot(x,np.sin(x+i*0.5) * (7-i) * flip)
    
    data = np.random.normal(size=(20,6)) + np.arange(6)/2
    # 使用 despine 进行操作
    # sns.violinplot(data)
    # sns.despine(offset = 10)
    # # offset 设置距离轴的距离
    # plt.show()
    
    # # 底部变为白色
    # sns.set_style("whitegrid")
    # # 让左面的竖线消失
    # sns.boxplot(data = data,palette = "deep")
    # sns.despine(left = True)
    # plt.show()
    
    # 五种主题风格 darkgrid whitegrid dark white ticks
    # # 绘制子图
    # with sns.axes_style("darkgrid"):
    #     # 第一种风格背景为黑色
    #     plt.subplot(211)
    #     # 分两个一列上面
    #     sinplot()
    # plt.subplot(212)
    # sinplot(-1)
    # plt.show()
    
    # # 设置布局,画图的大小和风格
    # sns.set_context("paper")
    # # sns.set_context("talk")
    # # sns.set_context("poster")
    # # sns.set_context("notebook")
    # # 线条粗细依次变大
    # plt.figure(figsize=(8,6))
    # sinplot()
    # plt.show()
    
    # # 设置坐标字体大小 参数 font_scale
    # sns.set_context("paper",font_scale=3)
    # plt.figure(figsize=(8,6))
    # sinplot()
    # plt.show()
    
    # # 设置线的粗度 rc = {"lines.linewidth":4.5}
    # sns.set_context("paper",font_scale=1.5,rc={"lines.linewidth":3})
    # plt.figure(figsize=(8,6))
    # sinplot()
    # plt.show()

    2020-04-24

  • 相关阅读:
    cmd登录系统用户
    Js操作Cookie
    Tomcat 调优方案
    Oracle 服务启动关闭
    Mysql服务启动与关闭
    JSP中的隐含对象
    JSP指令
    Js的String对象
    js排序
    MyBatis系列目录--5. MyBatis一级缓存和二级缓存(redis实现)
  • 原文地址:https://www.cnblogs.com/hany-postq473111315/p/12765847.html
Copyright © 2020-2023  润新知