Re: Vector, fill, contour in a panel plot

From: Correia, James <james.correia_at_nyahnyahspammersnyahnyah>
Date: Mon, 05 Jan 2009 13:45:57 -0800

Thanks Adam-
I just figured out that I needed to add:
resa_at_tfDoNDCOverlay = True

So that the mapping would be the same. I thought I had tried this solution
and perhaps I need to add the resource you suggested in order to make the
plot work. I will fiddle some more to see what I was doing wrong.
jimmyc

On 1/5/09 1:42 PM, "Adam Phillips" <asphilli_at_cgd.ucar.edu> wrote:

> Hi James,
>
> A shot in the dark:
> set resa_at_cnLineDrawOrder = "PostDraw"
>
> I wonder if the filled contours of your vector plot are being drawn
> after your separate contour plot..
> Adam
>
> Correia, James wrote:
>> Hi all-
>> I am having some difficulty overlaying a contour plot on top of a
>> vector-fill plot. I can draw "plota" and see contours, but when I overlay
>> plot(0) with plota, the contours do not appear on the base_plot plot(0). Am
>> I forgetting something, or missing something obvious here?
>>
>> Below is my code.
>> ; Plot it up
>> wks = gsn_open_wks("ps" ,var) ; ps,pdf,x11,ncgm,eps
>>
>> res = True ; plot mods desired
>> res_at_gsnMaximize = True ; uncomment to maximize size
>> res_at_gsnSpreadColors = True ; use full range of colormap
>> res_at_gsnScalarContour = True ; use full range of colormap
>> res_at_cnFillOn = True ; color plot desired
>> res_at_cnLinesOn = False ; turn off contour lines
>> res_at_cnLineLabelsOn = False ; turn off contour labels
>> res_at_lbLabelAutoStride = True ; let NCL figure lb stride
>> res_at_cnLevelSelectionMode = "ExplicitLevels" ; explicit [unequal] cn
>> levels
>>
>> res_at_cnFillMode = "RasterFill"
>> res_at_vcGlyphStyle = "LineArrow" ;windbarb, curlyvector
>> res_at_vcRefLengthF = .025
>> res_at_vcMinDistanceF = .02
>> res_at_vcWindBarbTickLengthF = 0.3
>> res_at_vcRefAnnoOn = True
>> res_at_vcRefMagnitudeF = 3.
>> ;************************************************
>> ; Use WRF_contributed procedure to set map resources
>> ;************************************************
>> WRF_map_c(g,res,0) ; set map resources
>> ;************************************************
>> ; set True for native mapping (faster plotting)
>> ; set to False othewise
>> ;************************************************
>> res_at_tfDoNDCOverlay = True
>>
>> ;************************************************
>> ; associate the 2-dimensional coordinates to variables for plotting
>> ; only if res_at_tfDoNDCOverlay=False
>> ;************************************************
>> if (.not.res_at_tfDoNDCOverlay) then
>> lat2d = f->XLAT(0,:,:) ; need for map limits
>> lon2d = f->XLONG(0,:,:)
>> end if
>>
>>
>> ;************************************************
>> ; allocate array for 3 plots
>> ;************************************************
>> plot = new (6,"graphic")
>> plota = new (1,"graphic")
>> plotb = new (1,"graphic")
>> ;************************************************
>> ; Specify (arbitrarily chosen) subscripts
>> ; This could also be done in a do loop or explicitly specified
>> ;************************************************
>> nt = 96 ; last time step
>> kl = 3
>>
>> lata = g->XLAT(0,:,:)
>> lona = g->XLONG(0,:,:)
>> x2 = 143
>> y2 = 118
>> x1 = 10
>> y1 = 10
>>
>> res_at_mpRightCornerLonF = lona(y2,x2)
>> res_at_mpRightCornerLatF = lata(y2,x2)
>> res_at_mpLeftCornerLonF = lona(y1,x1)
>> res_at_mpLeftCornerLatF = lata(y1,x1)
>>
>> res_at_cnLevels = (/2,4,8,16,25,40,60,80,90/)
>>
>> ;BlAqGrYeOrReVi200
>> color = (/"white","black","white", "LightBlue", "PaleGreen","green",
>> "yellow", "orange","orangered", "red", "purple","violet"/)
>>
>> colors = (/"blue", "LightBlue", "turquoise", "green", "white", "white",
>> "yellow", "orange", "red", "purple"/)
>> gsn_merge_colormaps(wks,color,colors)
>>
>>
>> res_at_gsnDraw =False
>> res_at_gsnFrame = False
>> res_at_gsnSpreadColorStart = 2
>> res_at_gsnSpreadColorEnd = 11
>>
>> plot(0) = gsn_csm_vector_scalar_map(wks,gu1,gv1,vark,res)
>>
>> ;contour v
>> resa = True
>> resa_at_cnLineThicknessF = 3.
>> resa_at_gsnDraw = False
>> resa_at_gsnFrame = False
>> resa_at_cnFillOn = False ; color plot desired
>> resa_at_cnLinesOn = True ; turn off contour lines
>> resa_at_cnLineLabelsOn = False ; turn off contour labels
>> resa_at_lbLabelAutoStride = True ; let NCL figure lb stride
>> resa_at_cnLevelSelectionMode = "ExplicitLevels" ; explicit cnlevels
>> resa_at_cnLevels = (/0.5,2,3/)
>> plota = gsn_csm_contour(wks,gv1,resa)
>> overlay(plot(0),plota)
>> ;draw(plota)
>> ;frame(wks)
>>
>>
>>
>>
>> James Correia Jr., PhD
>> Climate Physics Group
>> Post. Doc.
>> Pacific Northwest National Lab
>>
>> "Wisdom. Strength. Courage. Generosity. Each of us are born with one of
>> these. It is up to us to find the other three inside of us."
>> -Into the West
>>
>>
>> _______________________________________________
>> 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 Mon Jan 05 2009 - 14:45:57 MST

This archive was generated by hypermail 2.2.0 : Thu Jan 08 2009 - 08:41:28 MST