Re: Overlaying contours

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Mon Jun 06 2011 - 15:19:35 MDT

Hi Agnes,
You cannot overlay a map plot onto a map plot. Or at least you can't do
it when using overlay or the *overlay mapping functions. (You can
manually overlay things though by not advancing the frame and drawing
plots one on top of another.)

Change this:
cplot = gsn_csm_contour_map(wks,ctrl_wrf_GHGT(ilev,:,:),res)
to this:
cplot = gsn_csm_contour(wks,ctrl_wrf_GHGT(ilev,:,:),res)

You will get error messages saying all res@mp* resources are invalid.
You can ignore these or create a 2nd resource list without any mp
resources. Either way works. Hope that helps! Adam

On 06/06/2011 03:12 PM, Agnes Lim wrote:
> Hi
>
> I am trying to overlay geopotential heights at 500mb for different
> experiments on the same plot. But get the following errors
> "fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot member"
>
> I had used the overlay method because i wanted to overlay 3 sets of
> contours. However, before i could not get through the first overlay.
>
> Agnes
>
> ===================================================
> wks = gsn_open_wks("x11" ,filename+"_ghgt_500") ; open
> a:q!:q ps file
> res = True ; plot mods desired
> gsn_define_colormap(wks,"gui_default") ; select color map
>
> res@gsnSpreadColors = True
> res@mpLandFillColor = -1 ; set land to be
> transperant
> res@mpOutlineOn = True
> res@mpOutlineBoundarySets = "AllBoundaries"
> res@mpProjection = "LambertConformal"
> res@mpEllipticalBoundary = False ; If you want
> elliptical
> res@cnFillOn = False
> res@cnLinesOn = True
> res@cnLineLabelsOn = False
> res@lbBoxLinesOn = True
> res@mpMinLatF = 7 ; range to zoom in on
> res@mpMaxLatF = 56
> res@mpMinLonF = -170
> res@mpMaxLonF = -53
> res@tmXTOn = False ; Turn off top tickmarks and labels
> res@tmYROn = False ; Turn off left tickmarks and labels
> res@tmXBLabelFontHeightF = 0.01 ; resize tick labels
> res@tmYLLabelFontHeightF = 0.01
> res@pmTickMarkDisplayMode = "Always"
> res@mpLambertParallel1F = 35.072
> res@mpLambertParallel2F = 35.072
> res@mpLambertMeridianF = -111.029 ; or f@CEN_LON
> res@lbLabelAutoStride = True
> res@lbLabelBarOn = False
> res@gsnMaskLambertConformal = True
> res@cnLevelSelectionMode = "ManualLevels"
> res@cnMinLevelValF = -5340
> res@cnMaxLevelValF = 5940
> res@cnLevelSpacingF = 50
> res@gsnAddCyclic = False
> res@cnLineColor="black"
> res@gsnDraw=False
> res@gsnFrame=False
>
> plot = gsn_csm_contour_map(wks,gfs_GHGT(ilev,:,:),res)
>
> res@cnLineColor="red"
> cplot = gsn_csm_contour_map(wks,ctrl_wrf_GHGT(ilev,:,:),res)
>
> overlay(plot,cplot)
> gsnMaximize = True
> draw(plot)
> frame(wks)
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
______________________________________________________________
Adam Phillips                                asphilli@ucar.edu
NCAR/Climate and Global Dynamics Division       (303) 497-1726
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jun 6 15:19:44 2011

This archive was generated by hypermail 2.1.8 : Thu Jun 09 2011 - 14:56:48 MDT