[ncl-talk] Fwd: problem using ShadeGtContour function

Adam Phillips asphilli at ucar.edu
Mon May 11 17:32:24 MDT 2015


Hi Rashed,
If I understand the documentation correctly, one cannot pattern fill when
cnFillMode = "CellFill" (or "RasterFill"). That is why you are getting
black boxes.

A couple of weeks ago Dave Brown sent a reply to a ncl-talk query of
Frank Kreienkamp
who was asking a similar type of question. From Dave's reply:

A quirk, or perhaps a feature, of the AreaFill method is that the cells
immediately adjoining an area of missing values are also treated as
missing. In your example plot this reduces the stippled area to a fraction
of what one might reasonably suppose it should be. One way to work around
this is to eliminate the missing values. The idea is to set the missing
values to a value outside the good value range, to a value that creates a
plausible gradient from the nearest good value. Then set up the levels and
level colors such that the formerly missing values will be drawn as a
transparent color.


Dave's suggestion is a good way to proceed with your issue. I have attached
a modified version of your script, along with two .gif images. The first
image shows the significant grid boxes (colored black) and the gray
stippling overlaid on one another. With some testing one should be able to
get gray stippling on each black grid box. The second image shows your plot
with the stippling applied.

Note that I modified your script to no longer use ShadeGtContour to give
complete direct control of the stippling resources. It took some trial and
error with setting the _FillValue attribute, along with the cnFillScaleF
and cnFillDotSizeF resources (lines 69-72). You will likely have to modify
those settings if your stippling field changes. I commented out lines 64-66
and 74-77 as those were used to create the (trial and error) plot #1.

Hope that helps.. If your have any further questions please respond to the
ncl-talk email list.
Adam


On Mon, Apr 13, 2015 at 9:25 PM, Rashed Mahmood <rashidcomsis at gmail.com>
wrote:

>
> Hi all,
> Sorry if this message is repeated, last message was bounced back perhaps
> because of the size of attached files, Below is my question.
>
>
> I have been trying to use "ShadeGtContour" to get the stiplling pattern on
> top of a map plot.
> However the points do not appear on the plot, perhaps because these data
> points are very few and sparse. Please see the top plot in attached figure.
>
> I could plot the points on the same map plot using "CellFill" resource,
> but I would like them to appear as dots rather than filled boxes. See the
> bottom plot in attached figure.
>
> The script and the two input files are attached that can used to produce
> the problem.
> Can anyone give some suggestions on how to get stiplling pattern when the
> data points are few and sparse.
>
> Thanks
> Rashed
>
>
> _______________________________________________
> ncl-talk mailing list
> 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/20150511/a5399c0f/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scf_example2.ncl
Type: application/octet-stream
Size: 2276 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150511/a5399c0f/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image1.gif
Type: image/gif
Size: 13520 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150511/a5399c0f/attachment.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image2.gif
Type: image/gif
Size: 87212 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150511/a5399c0f/attachment-0001.gif 


More information about the ncl-talk mailing list