立即注册 登录
气象家园 返回首页

adam_5的个人空间 http://bbs.06climate.com/?8934 [收藏] [复制] [分享] [RSS]

日志

关于matplotlib的Basemap工具包的一些方法参数设置

已有 770 次阅读2017-5-4 11:34 | 工具包

最近学习Basemap,做一些笔记,一些一看就明白的参数就不说了

bmap = Basemap( )

绘制海岸线 bmap.drawcoastlines(linewidth=1.,linestyle='solid',color='g',antialiased=1,ax=None,zorder=None)

  1. linestyle : '-' or 'solid'  实线;'--' or 'dashed' 破折线;'-.'or'dashdot' 点划线;':' or 'dotted'  虚线
  2. antialiased防锯齿开关,default True(非0为真)
  3. zorder:绘制图层顺序,低zorder的先绘制,z轴方向为屏幕指向观察者,0为屏幕上,1为上面的一层,以此类推
  4. ax:画布选择,多个画布时选择在哪个画布上绘制
绘制县边界 map.drawcounties(linewidth=0.1,linestyle='solid',color='b',antialiased=1,ax=None,zorder=None,
drawbounds=False)
  1. drawboundsraw boundaries of shapes (default True),绘制shape文件的边界,缺省打开

绘制底图边界 bmap.drawmapboundary(color='y',linewidth=1.0,fill_color='g',zorder=None,ax=None)

  1. fill_colorfill the map region background with this color (default is to fill with axis background color).   If set to the string'none', no filling is done.填充底图背景区域颜色,缺省与坐标轴颜色相同,None为不填充

绘制国界 bmap.drawcountries(linewidth=0.5,linestyle='solid',color='k',antialiased=1,ax=None,zorder=None)

绘制经度线(子午线) bmap.drawmeridians(meridians,color='k',linewidth=1., zorder=None,dashes=[1,1],labels

                                 [0,0,0,0],labelstyle=Nonefmt='%g',xoffset=None,yoffset=None,ax=None,latmax=None)

Draw and label meridians (longitude lines) for values (in degrees)given in the sequence ``meridians``绘制‘meridians’取值为子午线值得经度线,(可以用一个序列来画多个经度线)

  1. meridians,子午线
  2. dashes:dash pattern for meridians (default [1,1], i.e.1 pixel on, 1 pixel off),破折线的样式,列表中第一个为线的长度,第二个为空的长度
  3. labels:list of 4 values (default [0,0,0,0]) that control whether meridians are labelled where they intersect the left, right, top or bottom of the plot. For example labels=[1,0,0,1] will cause meridians to be labelled where they intersect the left and and bottom of the plot, but not the right and top.列中的4个数字表示线标签的位置,分别为左、右、上、下,都为0时,不绘制标签。
  4. labelstyle:if set to "+/-", east and west longitudes are  labelled with "+" and "-", otherwise they are labelled with "E" and "W".如果用+、-号表示的话,东为+,西为-,负责用E、W表示
  5. fmt:a format string to format the meridian labels (default '%g') **or** a function that takes a longitude value in degrees as it's only argument and returns a formatted string.子午线标签的字符串格式,或者画经度线时设定一个值作为固定标记值,或者缺省返回线值。
  6. xoffset:label offset from edge of map in x-direction (default is 0.01 times width of map in map projection coordinates)标签的x轴的偏移量
  7. yoffset:label offset from edge of map in y-direction (default is 0.01 times height of map in map projection coordinates).标签的y轴的偏移量
                         













#y4in3gjSTips { position: absolute; left: 9999999999em; z-index:999999999;width:56px; height:24px} #y4in3gjSTips a { background: url(http://mat1.gtimg.com/www/sogou/sogou_tips_v1.png) no-repeat 0 0; display: block; width: auto; height: 24px; line-height: 24px; padding-left: 23px; color: #000; font-size: 12px; text-decoration: none; _position:relative; margin: -32px 0 0; } #y4in3gjSTips a:hover { color:#45a1ea; background-position: 0 -34px }搜索

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 立即注册

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

返回顶部