爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 4469|回复: 2

[作图] 横轴和纵轴如何只显示给定的区间范围?

[复制链接]

新浪微博达人勋

发表于 2016-12-21 18:56:33 | 显示全部楼层 |阅读模式

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

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

x
大家好,请教一个问题,我想让横轴和纵轴只显示给定的区间范围,即横轴为3到8,纵轴也为3到8,程序和图如下,请问大家哪里出了问题?谢谢。

                               
登录/注册后可看大图

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

新浪微博达人勋

 楼主| 发表于 2016-12-21 18:57:25 | 显示全部楼层
begin

nt=101
nlev=81
nlat=161
nlon=161


q=new((/nt,nlev,nlat,nlon/),"float")
u=q
v=q
w=q
th=q
p=q

th2D=new((/nlon,nlat/),"float")
x=new(nlon,"float")
y=new(nlat,"float")

do gg=0,nt-1
  q(gg,:,:,:)=fbinrecread("./123.dat",0+6*gg,(/nlev,nlat,nlon/),"float")
  u(gg,:,:,:)=fbinrecread("./123.dat",1+6*gg,(/nlev,nlat,nlon/),"float")
  v(gg,:,:,:)=fbinrecread("./123.dat",2+6*gg,(/nlev,nlat,nlon/),"float")
  w(gg,:,:,:)=fbinrecread("./123.dat",3+6*gg,(/nlev,nlat,nlon/),"float")
th(gg,:,:,:)=fbinrecread("./123.dat",4+6*gg,(/nlev,nlat,nlon/),"float")
  p(gg,:,:,:)=fbinrecread("./123.dat",5+6*gg,(/nlev,nlat,nlon/),"float")
end do


do j=0,nlat-1
  do i=0,nlon-1
      th2D(i,j)=th(nt-1,11,j,i)
      x(i)=0.0625*i
      y(j)=0.0625*j
   end do
end do

;th2D=th2D(:,:)
;th2D@lon2d=x(:,:)
;th2D@lat2d=y(:,:)

th2D!0="lon"
th2D!1="lat"
th2D&lon=x
th2D&lat=y
printVarSummary(th2D)

wks=gsn_open_wks("x11","plot")
res=True

res@tmXBMode="Explicit"
res@tmXBValues=ispan(3,8,1)
res@tmXBLabels=(/3,4,5,6,7,8/)
res@tmLabelAutoStride=True


res@tmYLMode="Explicit"
res@tmYLValues=ispan(3,8,1)
res@tmYLLabels=(/3,4,5,6,7,8/)
res@tmLabelAutoStride=True

plot=gsn_csm_contour(wks,th2D,res)


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

新浪微博达人勋

 楼主| 发表于 2016-12-21 18:59:10 | 显示全部楼层
C:\Users\qxt\Desktop\123.jpg
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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