[ncl-talk] gsn_contour_shade

Adam Phillips asphilli at ucar.edu
Mon Nov 7 10:13:07 MST 2016


Hi Jonathan,
gsn_contour_shade does not recognize resources beyond those listed on the
function documentation page. I would suggest copying the function from
$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl, renaming it say
gsn_contour_shade2, add the resources you want directly into the new
function, and then load gsn_contour_shade2 at the top of your script.
Specifically, change this coding within the function:
else
  setvalues idstring
     "cnFillOn"          : True
     "cnMonoFillColor"   : True
     "cnMonoFillPattern" : False
     "cnFillPatterns"    : colist
  end setvalues
to this:
else
  setvalues idstring
     "cnFillOn"          : True
     "cnMonoFillColor"   : True
     "cnMonoFillPattern" : False
     "cnFillPatterns"    : colist
     "cnFillScaleF"    : 0.1
     "cnFillDotSizeF" : 0.5
  end setvalues

That should do the trick.
Adam



On Mon, Nov 7, 2016 at 8:33 AM, Buzan, Jonathan R <jbuzan at purdue.edu> wrote:

> Hi David,
>
> I see no change in the density or size of my stipple pattern.  I’ve tried
> various combinations:
>
>   opt = True
>   opt at gsnShadeFillType = "pattern"
>   opt at gsnShadeHigh = 17
>   opt at cnMonoFillScale = True
>   opt at cnFillScaleF = 0.1
> ;  opt at cnMonoFillScale = False
> ;  opt at cnFillScales = (/0,0,17/)
> ;  opt at cnFillScaleF = 0.1
> ;  opt at cnFillDotSizeF = 0.5
>
>     plots1  = gsn_contour_shade(plots1,minshade,maxshade,opt)
>
> -Jonathan
>
>
>
>
>
> > On Nov 4, 2016, at 6:25 PM, David Brown <dbrown at ucar.edu> wrote:
> >
> > You may actually want to use cnFillScaleF, the scalar resource that
> > applies to all fill pattern instances in the plot when cnMonoFillScale
> > is set True (the default).
> > cnFillScales is the companion array resource that allows you to set
> > different fill scalings (densities) for each contour fill level. For
> > it to apply you need to set cnMonoFillScale to False.
> > For stipple fill in particular you might also want to be aware of
> > cnFillDotSizeF if you are not already.
> > -dave
> >
> >
> >
> > On Fri, Nov 4, 2016 at 4:02 PM, Buzan, Jonathan R <jbuzan at purdue.edu>
> wrote:
> >> Hello NCL-Talk,
> >>
> >> I am using the gsn_contour_shade command, with pattern 17 (stipple).  I
> am attempting change the density of the stipple, however, the
> gsn_contour_shade page does not list any commands to do so.
> >>
> >> I tried,  opt at cnFillScales = 0.5 but the command was not accepted
> and/or did not apply.
> >>
> >>
> >> -Jonathan
> >>
> >>
> >> _______________________________________________
> >> ncl-talk mailing list
> >> ncl-talk at ucar.edu
> >> List instructions, subscriber options, unsubscribe:
> >> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>



-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161107/1e4f0cf7/attachment.html 


More information about the ncl-talk mailing list