Re: Overlays (basemap+2 contours) in Panel Plot

From: Alan Brammer <abrammer_at_nyahnyahspammersnyahnyah>
Date: Sun Sep 23 2012 - 13:45:35 MDT

you need to set up an array for the plots to be held and not draw or frame them as gsn_panel will do this for you. I think this will work, may be an issue with continually overwriting plot2 & plot3 though.

untested but I think this will work.

Alan.

e.g.

plot = new( 4, graphic)
do i=0,3
  res@tiMainString = "Stream Function and Velocity Potential 850 hPa ~C~ ~Z55~ "+var(i)+ "
  plot(i) = gsn_csm_map_ce(wks,mpres)
  plot2 = gsn_csm_contour(wks,sf(i,:,:),res)
  plot3 = gsn_csm_contour(wks,vp(i,:,:),cnres)
  overlay(plot(i),plot2)
  overlay(plot(i),plot3)
end do
  pnlres = True
  pnlres@txString = ""
  pnlres@gsnPanelLabelBar = True
  pnlres@lbLabelAutoStride = True
  pnlres@gsnPanelDebug = True
  gsn_panel(wks,plot,(/2,2/),pnlres)

end
delete(plot) ; if you have ncl6.x delete( [/ plot, plot2, plot3, wks/] )
delete(plot2)
delete(plot3)
delete(wks)

-------------------------------------
Alan Brammer,
PhD Student

Department of Atmospheric and Environmental Sciences, University at
Albany, SUNY, Albany, NY, 12222

-------------------------------------

On Sep 23, 2012, at 2:48 PM, Erika Folova <e.folova@gmail.com> wrote:

> HI All,
>
> I just wonder why my overlay plots didnt work appropriately (only one figure appearing) when i want to plot my 4 overlays map to single panel plot [2x2].
> I have the script as follow:
>
> [SNIP]
>
> do i=0,3
> res@tiMainString = "Stream Function and Velocity Potential 850 hPa ~C~ ~Z55~ "+var(i)+ "
> plot1 = gsn_csm_map_ce(wks,mpres)
> plot2 = gsn_csm_contour(wks,sf(i,:,:),res)
> plot3 = gsn_csm_contour(wks,vp(i,:,:),cnres)
> overlay(plot1,plot2)
> overlay(plot1,plot3)
> draw(plot1)
> frame(wks)
> end do
> pnlres = True
> pnlres@txString = ""
> pnlres@gsnPanelLabelBar = True
> pnlres@lbLabelAutoStride = True
> pnlres@gsnPanelDebug = True
> gsn_panel(wks,plot1,(/2,2/),pnlres)
>
> end
> delete(plot1)
> delete(wks)
> --
>
> Cheers,
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Sep 23 13:45:50 2012

This archive was generated by hypermail 2.1.8 : Wed Sep 26 2012 - 13:56:04 MDT