seaborn

import seaborn as sns
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
%matplotlib inline
def sinplot(flip=1):
    x=np.linspace(0,14,100)#linspace(m,n,z) z是指定在m、n之间取点的个数,
                            #另外它取点的区间是[m,n],即是会包括终点n的。
    for i in range(1,7):
        plt.plot(x,np.sin(x+i*5)*(7-i)*flip)
sinplot()

在这里插入图片描述

sns.set_style("ticks")#设置五种风格 darkgrid\whitegrid\dark\whie\ticks
sinplot()

在这里插入图片描述png

#a=np.random.normal(size=(20,6))
#print(a)
#b=np.arange(6)


#''''numpy.random.normal(loc=0.0, scale=1.0, size=None)
#loc:float
    #此概率分布的均值(对应着整个分布的中心centre)
#scale:float
   # 此概率分布的标准差(对应于分布的宽度,scale越大越矮胖,scale越小,越瘦高)
#size:int or tuple of ints
    #输出的shape,默认为None,只输出一个值
#''''''
range(0, 6)
a=np.random.normal(size=(20,6))+np.arange(6)/2
sns.boxplot(data=a)

在这里插入图片描述png

np.random.normal(1,1,(2,2))
array([[2.30269651, 0.61277528],
       [1.05518652, 1.88139238]])
sinplot()
sns.despine(offset=30)#图像离轴的举距离

在这里插入图片描述png

sinplot()
sns.despine(right=False)#加上右边的线

在这里插入图片描述

with sns.axes_style("dark"):   #with里面的风格和with外面的风格不一样
    plt.subplot(211)           #sns.axes_style() 设置子图风格
    sinplot()

plt.subplot(212)
sinplot(-1)

在这里插入图片描述

sns.set_context("notebook",font_scale=3)#设置显示比例尺度 set_context() 包括paper,notebook,talk,poster;font_scale设置字体的值
plt.figure(figsize=(8,6))
sinplot()

在这里插入图片描述

sns.set_context("paper")
plt.figure(figsize=(8,6))
sinplot()

在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值