- 积分
- 525
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2020-3-31
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
求助各位大神,我在画一个任意量的垂直剖面图plot,和地形的折线图plot1,单独画折线图plot1的时候能将折线图与参考线之间的颜色填为黑色表示为地形,但是将其与填色图plot叠加后就只有折现,没有填色了。太奇怪了,求助!
我开始想着是折线图的Y轴边界与填色图可能不匹配,故将大于1000hpa的值用where函数转化为1000,结果还是没有变化。
代码如下
begin
;f = addfile("J:/data/shp/DAT/ETOPO1_Bed_g_gmt4.grd.nc", "r")
fw = addfile("J:/data/ERA5/vvandrevo-adaptor.mars.internal.nc", "r")
w1 = short2flt(fw->w)
year = ispan(1991,2020,1)
w1!0 = "year"
w1&year = year
w2 = w1*100
copy_VarMeta(w1, w2)
temp = w2({1994},:,{35},{60:120})
printVarSummary(temp)
f = addfile("J:/data/shp/DAT/topo_0.25.nc", "r")
fz = doubletofloat(f->z)
printVarSummary(fz)
lat = fspan(-90, 90, 721)
lon = fspan(-180,180, 1441)
fz!0 = "lat"
fz!1 = "lon"
fz&lat = lat
fz&lon = lon
printVarSummary(fz)
tz = fz({35},{60:120})
printVarSummary(tz)
elev = 1013.25*(1-tz*0.0065/288.15)^5.25145
lon1 = fspan(60, 120, 241)
elev!0 = "lon1"
elev&lon1 = lon1
printVarSummary(elev)
;nan = elev@Fill_Value
e2 = where(elev.ge.1000, 1000, elev) ;算完后的折线图最低气压大于1000hpa,这里将大于1000的全部规整为1000
; print(e2)
; exit
;; Draw map
wks = gsn_open_wks("png","G:/NCL/pic/mask-3") ; send graphics to PNG file
res = True ;填色背景图
res@gsnMaximize = True
res@gsnDraw = False
res@gsnFrame = False
res@tmBorderThicknessF = 6.0 ; border 6x as thick
res@tmXTOn = False ; Turn off top and right
res@tmYROn = True ; tickmarks
res@trXMinF = 60 ; Set min/max of X axis
res@trXMaxF = 120
res@trYReverse = True ; Reverse Y axis
;res@cnFillMode = "AutomaticLevels"
res@cnFillOn = True
res@cnFillColor = True
res@cnLinesOn = False
;res@cnInfoLabelOn = False
res@cnSmoothingOn = True
res@pmLabelBarWidthF = 0.6 ; Change size of labelbar
res@pmLabelBarHeightF = 0.05
res@pmLabelBarOrthogonalPosF = 0.05
res@lbLabelFontHeightF = 0.010
plot = gsn_csm_contour(wks,temp,res)
gres = True ;折线
gres@gsnDraw = False
gres@gsnFrame = False
; gres@cnSmoothingOn = True
; gres@cnFillPalette = "gsltod"
gres@trYReverse = True
gres@tmYLTickStartF = 1000
gres@tmYLTickEndF = 200
gres@gsnYRefLine = 1000
gres@gsnAboveYRefLineColor = 1
;gres@gsnBelowYRefLineColor = 1
plot1 = gsn_csm_xy(wks, lon1, e2, gres)
overlay(plot,plot1)
draw(plot)
frame(wks)
end
|
-
-
|