Re: Use explicit color level and wrf_contour

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Sat Apr 28 2012 - 07:29:54 MDT

[1] NCL will use the first 'plevel+1' colors which it is doing.

[2] As far the label frequency, perhaps 'wrf_contour' is setting
     the 'lbLabelStride' or 'lbLabelAutoStride'. The 'wrf_contour'
     function was written by wrfhelp@ucar.edu (cc'd here).

     Perhaps the following settings will work

res@lbLabelAutoStride = False
res@lbLabelStride = 1

You can look at the wrf_* code

%> less $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl

and see the settings they use for wrf_contour

On 4/27/12 11:56 PM, Zheng Lu wrote:
> Hi,
>
> I tried to plot a color contour figure using wrf_contour and explicit
> color level. However, as shown in the attachment, instead of showing all
> the values, the colorbar only shows half levels. Could anyone help me
> with this problem? Many thanks in advance.
>
> Zheng
>
> code:
>
> wks = gsn_open_wks("x11", "wrf")
> gsn_define_colormap(wks,"prcp_3")
>
> res = True
> res@cnFillOn = True ; color fill
> res@cnLinesOn = False ; Turn off contour lines
> res@cnLevelSelectionMode = "ExplicitLevels"
> res@lbLabelAngleF = 45
>
> plevel = (/1, 20, 30,40,50,60,70,80,90,100,200,300,400,800/)
> pcolor = (/4,5,6,7,8,9,10,11,12,13,14, 15,16,17,18, 24,25,26/)
>
> res@cnLevels = plevel
> res@cnFillColors =pcolor
>
>
> res@cnInfoLabelOn = False
> res@cnConstFLabelOn = False
> res@cnFillOn = True
>
> res@NoHeaderFooter=True
> res@InitTime=False
> res@FieldTitle=""
> res@Footer = False
> res@gsnDraw =False
> res@gsnFrame=False
>
>
> contour = wrf_contour(b,wks,lwp,res)
>
> pltres = True ; Set plot options
> mpres = True ; Set map options
> pltres@FramePlot=False
> pltres@NoTitles=True
> pltres@CommonTitle=False
> pltres@PanelPlot=True
> mpres@mpGeophysicalLineColor = "Black" ; Overwrite basic map
> settings
> mpres@mpGridLineColor = "Black"
> mpres@mpLimbLineColor = "Black"
> mpres@mpNationalLineColor = "Black"
> mpres@mpPerimLineColor = "Black"
> mpres@mpGridAndLimbOn = True ; turn on lat/lon lines
> mpres@mpTickMarkDisplayMode = "Always" ; turn on automatic tickmarks
> mpres@mpGridLineThicknessF =1.2
> mpres@mpGridSpacingF= 5
>
>
> plot = wrf_map_overlays(b,wks,(/contour/),pltres,mpres) ; Plot the
> data over a map background
>
> draw(plot)
> frame(wks)
> end
>
>
>
> _______________________________________________
> 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 Sat Apr 28 07:30:02 2012

This archive was generated by hypermail 2.1.8 : Mon Apr 30 2012 - 09:21:12 MDT