Overlay is not working

From: Abhik Santra <abhiksantra_at_nyahnyahspammersnyahnyah>
Date: Wed Jan 02 2013 - 01:08:23 MST

Hello ncl-talk,

I am trying to make 6 overlay plots in a single panel from two different datasets having different resolutions (1.25x1.25 and 1x1 degrees).
But my overlay plots didn't work appropriately as only one set of figures are appeared in the panel.

I have the script as follow:

begin

plot = new(6,graphic)
wks = gsn_open_wks("eps","test")
gsn_define_colormap(wks,"BlWhRe")

do j=0, 5

f1 = addfile ("XZ"+j+".nc" , "r") : res: 1.25Dx1.25D
f2 = addfile ("X"+j+".nc" , "r") ; res: 1Dx1D

z = f1->zz(0,:,:)
x = f2->xx(0,:)

lon = xx&lon

res = True
res@cnFillOn = True ; turn on color fill
res@gsnDraw = False ; do not draw picture
res@gsnFrame = False ; do not advance frame
res@lbLabelBarOn = False ; no individual label bars
res@gsnSpreadColors = True ; use full colormap
res@cnLinesOn = True ; no contour lines
res@cnLineThicknessF = 0.6
res@cnLineColor = "gray"
res@cnInfoLabelOn = False ; turn off cn info label
res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
res@cnMinLevelValF = -0.3 ; set min contour level
res@cnMaxLevelValF = 0.3 ; set max contour level
res@cnLevelSpacingF = 0.05 ; set contour spacing
res@cnLineLabelsOn = False
res@tmXBLabelFontHeightF = 0.0
res@tmYLLabelFontHeightF = 0.018
res@tmYROn = False
res@tmYRMinorOn = False
res@trYReverse = True
res@vpHeightF = 0.2 ; default 0.6
res@vpWidthF = 0.8 ; default 0.6

plotz = gsn_csm_contour(wks,z,res) ; !! This is only coming in the panel !!

xyres = True
xyres@gsnDraw = False ; don't draw
xyres@gsnFrame = False
xyres@tmXTOn = False
xyres@tmYLOn = False
xyres@tmYROn = True
xyres@tmYRLabelsOn = True
xyres@trYMinF = -5. ; set Y-axis max and mins
xyres@trYMaxF = 5.
xyres@gsnYRefLine = 0. ; Y-value for ref. line
xyres@xyLineThicknesses = (/3./) ; Define line thicknesses
xyres@xyLineColors = (/"black"/) ; Define line color
xyres@trXMaxF = 360.

plotx = gsn_csm_xy(wks,lon,x,xyres)
overlay(plotz,plotx)
plot(j) = plotz

delete(plotz)
delete(plotx)
delete(res)
delete(xyres)
delete(ntim)
delete(x)
delete(z)

j=j+1

end do
;*******************************************
; create panel resources
;*******************************************
   resP = True ; mods desired
   resP@gsnFrame = False ; save panel until all ready
   ;resP@gsnMaximize = True ; Maximize in frame
   resP@gsnPanelBottom = 0.35
   resP@gsnPanelLabelBar = True ; commom label bar
   resP@lbLabelStride = 2 ; every 2nd label
   resP@lbLabelFontHeightF = 0.01
   resP@pmLabelBarHeightF = 0.06
   resP@gsnPanelFigureStringsFontHeightF = 0.007
   resP@pmLabelBarOrthogonalPosF = 0.01
   resP@gsnAttachPlotsXAxis = True
   resP@gsnScale = True

   gsn_panel(wks,plot,(/6,1/),resP) ; create panels

   frame(wks)
 end

Can anyone suggest me the way to solve this problem?
Thanks in advance and wish you a happy new year.

Regards,
Abhik
______________________________
Abhik Santra
CSIR Research Fellow,
Indian Institute of Tropical Meteorology,
Pune - 411008.
India
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jan 2 01:20:51 2013

This archive was generated by hypermail 2.1.8 : Fri Jan 04 2013 - 15:34:10 MST