爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 21764|回复: 17

[作图] 如何改变坐标中的经纬度间隔

[复制链接]

新浪微博达人勋

发表于 2016-11-17 11:04:39 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
求问,改变坐标中经纬度间隔的设置应该是以下两句
  res@gsnMajorLonSpacing       =5.
  res@gsnMinorLonSpacing       =1.  
但是画图出来依旧是原来间隔的样子,如图
resource 代码如下,是需要其他辅助设置还是我的res与其出现冲突了呢?请帮忙解答
res                     = True          ; plot mods desired
  res@gsnMaximize         = True;False
  res@gsnDraw      = False
  res@gsnFrame     = False     
  
  res@gsnAddCyclic      = False
  res@cnFillMode           = "RasterFill"
  res@cnRasterSmoothingOn = True
  res@cnFillOn            = True          ; turn on color
  res@gsnSpreadColors     = True          ; use full range of colormap
  res@cnMonoFillColor      = False    ; Use multiple colors.
  res@cnLinesOn             = False
  res@mpDataBaseVersion     = "MediumRes"          ; Default is LowRes
  res@mpDataSetName="Earth..4"
  res@gsnPaperOrientation = "portrait"
  res@mpLimitMode = "LatLon"
  res@mpMinLonF = 111.5
  res@mpMaxLonF = 122.
  res@mpMinLatF = 30.
  res@mpMaxLatF = 37.
  
  res@gsnMajorLonSpacing       =5.
  res@gsnMinorLonSpacing       =1.   
  res@gsnMajorLatSpacing       =5.
  res@gsnMinorLatSpacing       =1.
   
  res@pmTickMarkDisplayMode   = "Always";shezhi meige zuobiao kedu douyou zhi
  res@mpAreaMaskingOn        = True
  res@mpFillDrawOrder        = "PostDraw"
  res@mpDataBaseVersion      = "MediumRes"
  res@mpFillBoundarySets     = "Geophysical"
  res@mpMaskAreaSpecifiers   = (/"China","Taiwan"/)
  res@mpOutlineSpecifiers    = (/"China","Taiwan",\
   "Disputed area between India and China"/)
  res@mpOutlineBoundarySets  = "NoBoundaries"
  res@mpFillOn               = True
  res@mpOceanFillColor       = 0
  res@mpLandFillColor        = 0
  res@mpInlandWaterFillColor = 0
  res@cnLevelSelectionMode = "ExplicitLevels"

  res@cnLevels             =(/-0.24,-0.20,-0.16,-0.12,-0.08,-0.04,0,0.04,0.08,0.12,0.16,0.20,0.24,0.28/)
;  res@cnFillColors         =  (/21,20,19,18,17,15,13,10,9,8,7,6,5,4,3,2/)  
  res@tiMainFontHeightF        =0.03
  res@lbLabelFontThicknessF     =2
  res@lbLabelFontAspectF        =2
  res@lbLabelFontHeightF        =0.02

  res@vpWidthF            = 0.5           ; change aspect ratio of plot
  res@vpHeightF           = 0.3
_`~1N06]V82}S3W@~`@AN1X.png

评分

参与人数 1金钱 +5 收起 理由
ddzsn + 5

查看全部评分

密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-11-17 18:58:02 | 显示全部楼层
res@tmYLMode              = "Explicit"             ;对Y轴的坐标进行设置,显示自己想要的值
  res@tmYLValues=(/1000,500,200,70,50,30,20,10/)
  res@tmYLLabels=(/1000,500,200,70,50,30,20,10/)
同理
  res@tmXBMode              = "Explicit"
  res@tmXBValues=(/-30,-10,10,30,50/)
  res@tmXBLabels=(/-30,-10,10,30,50/)
密码修改失败请联系微信:mofangbao
回复 支持 2 反对 0

使用道具 举报

新浪微博达人勋

发表于 2016-11-18 08:24:31 | 显示全部楼层
猜测可能是 res@pmTickMarkDisplayMode的锅
密码修改失败请联系微信:mofangbao
回复 支持 2 反对 0

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2016-11-18 10:47:52 | 显示全部楼层
井中月 发表于 2016-11-18 08:24
猜测可能是 res@pmTickMarkDisplayMode的锅

非常感谢,果然是这个问题
密码修改失败请联系微信:mofangbao
回复 支持 1 反对 0

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2016-11-17 19:14:47 | 显示全部楼层
liyf 发表于 2016-11-17 18:58
res@tmYLMode              = "Explicit"             ;对Y轴的坐标进行设置,显示自己想要的值
  res@tmY ...

用了之后显示warning :MapPlotSeValues: tm[XB|XT]Mode resources are not currently enabled for MapPlot tick marks
warning:tnYLValues is not a valid resource in map at this time
因为我画图的时候,用了plot=gsn_csm_contour_map(xwks,pre,res)
是因此不可以吗?
请问这是怎么回事呢
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2016-11-18 11:20:46 | 显示全部楼层
井中月 发表于 2016-11-18 08:24
猜测可能是 res@pmTickMarkDisplayMode的锅

搜了一些例子,发现加上res@pmTickMarkDisplayMode   = "Always"这句话的话,就可以显示正常的°E的符号,不加的话,就要自己设置了,是吗?
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-11-21 09:17:13 | 显示全部楼层
橙子鲜 发表于 2016-11-18 11:20
搜了一些例子,发现加上res@pmTickMarkDisplayMode   = "Always"这句话的话,就可以显示正常的°E的符号 ...

应该是的,其实这个res我用的不多
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-11-24 13:03:44 | 显示全部楼层
橙子鲜 发表于 2016-11-18 10:47
非常感谢,果然是这个问题

你好!请教一下你,那需要怎么改呢?把那句话去掉的话就不显示经维度了。谢谢
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2016-11-25 14:35:07 | 显示全部楼层
Eric.Yang 发表于 2016-11-24 13:03
你好!请教一下你,那需要怎么改呢?把那句话去掉的话就不显示经维度了。谢谢

去掉之后,用下面几句设置间隔
  res@gsnMajorLonSpacing       =5.
   res@gsnMinorLonSpacing       =1.   
   res@gsnMajorLatSpacing       =5.
   res@gsnMinorLatSpacing       =1.
就是°不能显示了
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-11-28 15:07:54 | 显示全部楼层
橙子鲜 发表于 2016-11-25 14:35
去掉之后,用下面几句设置间隔
  res@gsnMajorLonSpacing       =5.
   res@gsnMinorLonSpacing       ...

回复晚了,不好意思啊,我设置里这几个属性后,经纬度坐标轴就不显示了,不知道是怎么回事
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

快速回复 返回顶部 返回列表