码迷,mamicode.com
首页 > 其他好文 > 详细

seaborn#1 style

时间:2017-08-31 12:39:52      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:offset   5.5   距离   idt   bsp   1.5   otto   画图   spi   

(一)   导入seaborn库:

(二)   在画图之前设置画图的风格: 

sns.set()

sns.axes_style("darkgrid"):

其中有五种风格可选择

  • darkgrid
  • whitegrid
  • dark
  • white
  • ticks

注:

1、   若要控制某子图的不同风格,可将改子图放在with范围内

with sns.axes_style("darkgrid"):

    plt.subplot(211)

    sinplot()

plt.subplot(212)

sinplot(-1)

2、   plt.figure(figsize=(8, 6))    :设置图片大小

3、   sns.despine(offset=10)     :offset值代表绘制的图形距离轴的距离

4、   sns.despine(left=True)      :隐藏轴线(left, right , bottom, top),设置为True则表示隐藏

5、   sns.set_context("poster")  :设置图形线条和轴刻度(paper, talk, poster依次增粗)

6、   sns.set_context("notebook", font_scale=1.5, rc={"lines.linewidth": 5.5})      #font_scale设置轴刻度数字大小, rc={"lines.linewidth": 1.5}设置图形内线条的大小

seaborn#1 style

标签:offset   5.5   距离   idt   bsp   1.5   otto   画图   spi   

原文地址:http://www.cnblogs.com/wqpkita/p/7457090.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!