[ncl-talk] cnConstFEnableFill usage?
Elizabeth Burakowski
burakows at ucar.edu
Wed Sep 10 16:09:16 MDT 2014
Hi NCL-Talk,
I am trying to use cnConstFEnableFill to stiple regions in a constant fill
color/pattern where signal/noise ratios are greater than two. However, I
keep getting an error that says:
warning:ContourPlotInitialize: scalar field is constant; no contour lines
will appear; use cnConstFEnableFill to enable fill
The plotting resources for my contour plot (res) and my signal:noise ratio
plot (snres) using cnConstFEnableFill is below. The plot turns out
perfectly fine, minus the desired stipling.
Is there a specific order I must put cnConstFEnableFill in my script that I
am missing? The full script is pretty long, so I've snipped out the bulk
of it and copied the plot resources information below. If the full script
is desired, it is available here:
/glade/p/work/burakows/plot/NCL/LC_Diff/biascorr_diff_PD_DF_mult_mean_panel.ncl
Thanks,
Liz.
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl"
;==========================================================
; The main code
;==========================================================
begin
<snip>
;----------------------------------------------------------------------
; Plotting options section
;----------------------------------------------------------------------
pltType = "ps" ; plot type
pltDir = "./" ; plot directory
pltName = "Panel_biascorr_"+varw+"PD-DF_2011" ; plot name (ps file)
pltPath = pltDir+pltName ; plot path
wks = gsn_open_wks(pltType,pltPath) ; create workstation
for ps file
gsn_define_colormap(wks,"temp_diff_18lev")
res = True
res at gsnDraw = False
res at gsnFrame = False
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 cnInfoLabelOn = False ; turn off info label (top labels of
indvid. plots)
res at cnFillMode = "RasterFill" ; turn raster on
res at cnLevelSelectionMode = "ManualLevels" ; Set contour levels manually
res at cnMinLevelValF = -4 ; minimum contour (degrees C,
or mm)
res at cnMaxLevelValF = 4 ; maximum contour
(degrees C, or mm)
res at cnLevelSpacingF = 0.5 ; contour interval
res at lbLabelBarOn = False ; Will turn on in panel
later
res at lbOrientation = "Horizontal" ; Horizontal label bar
res at mpFillOn = False
res at mpOutlineOn = True
res at mpOutlineBoundarySets = "AllBoundaries"
res at mpProjection = "CylindricalEquidistant"
res at mpLimitMode = "LatLon" ; required
res at mpMinLatF = minlat-bndadd
res at mpMaxLatF = maxlat+bndadd
res at mpMinLonF = minlon-bndadd
res at mpMaxLonF = maxlon+bndadd
res at mpCenterLonF = (minlon + maxlon)*0.5
res at mpCenterLatF = (minlat + maxlat)*0.5
res at gsnLeftString = "" ; Turn off left subtitle
res at gsnRightString = "" ; Turn off right
subtitle
res at gsnMajorLatSpacing = 2
;res at gsnMajorLonSpacing = 2
res at gsnMinorLonSpacing = 2
res at gsnAddCyclic = False ; regional grid (changes central meridian)/xwo
;----Resources for stipling of significant signal/noise (>2)
snres = True
snres at gsnDraw = False
snres at gsnFrame = False
snres at lbLabelBarOn = False ; turn off label bar
snres at cnInfoLabelOn = False ; turn off info label
snres at cnLineLabelsOn = False ; turn off contour labels
snres at cnLinesOn = False ; no contour lines
snres at cnConstFEnableFill= True ; allow constant values (1=sig) to fill
snres at cnFillOn = True ; turn on fill
snres at cnMonoFillPattern = True ; single fill pattern
snres at cnFillColor = "black" ;
snres at cnFillPattern = 17 ; stipling
<snip>
plot_diff = gsn_csm_contour_map(wks,Wrfdiff_mean,res)
plot_sn = gsn_csm_contour(wks,Wrfdiff_sn2,snres)
overlay(plot_diff,plot_sn)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140910/0cdc8f14/attachment.html
More information about the ncl-talk
mailing list