[ncl-talk] Could I add some FillPatterns effect such as obliquelines to a raster fill plot ?

Adam Phillips asphilli at ucar.edu
Sat Aug 22 22:24:38 MDT 2015


Hi Lin,
You are correct, you cannot raster fill and pattern fill at the same time. However, I remembered that I replied to someone with this issue in April. See the response here: 
http://mailman.ucar.edu/pipermail/ncl-talk/2015-April/002370.html
In short: you need to manipulate the values of the boxes that are not hatched so that the pattern fill only covers the boxes that you want. Note in the example coding that the user had _FillValue(s); you may or may not have that set for the boxes you do not want pattern filled.

The above referenced method requires trial and error, but it is possible to do what you want.

An alternative to the above would be to make many calls to gsn_add_polyline, drawing a line across each grid box, but that method may be intensive to implement as well.

Good luck. If you have any other inquires please respond to ncl-talk.
Adam

> On Aug 21, 2015, at 10:05 PM, xianglin72 <xianglin72 at icloud.com> wrote:
> 
> Hi, Adam
> 
>       Thank you the reply.  I've tried what you have told before sending the first mail( see the attached script), however, I can not get what you and I expect ( see the attached plot).
>       I've checked the explaination on the resource of "raster fill", and found the following :
> 
>     The following resources can be used to control fill features when cnFillMode is set to RasterFill:
> cnFillColors
> cnGridBoundFillColor
> cnMissingValFillColor
> cnOutOfRangeFillColor
> cnRasterSmoothingOn
> cnRasterMinCellSizeF
> cnRasterSampleFactorF
> cnRasterCellSizeF
> 
>     So you can find that the cnMonoFillColor and cnFillPattern can not work for this mode, which I've said in the first mail.
> 
>     Since the "AreaFill" mode can not get the same effect and the "cnFillPattern" resource can not be used for "CellFill" and
> "rasterfill" mode, I still don't know how to add some shading effect for the chosen raster grids.  
> 
> Thanks
> 
> Lin
> 
>  
> 
>                              原始邮件                             
> 发件人: Adam Phillips<asphilli at ucar.edu>
> 收件人: xianglin72<xianglin72 at icloud.com>
> 抄送: ncl-talk at ucar.edu<ncl-talk at ucar.edu>
> 发送时间: 2015年8月22日(周六) 02:19
> 主题: Re: [ncl-talk] Could I add some FillPatterns effect such as obliquelines to a raster fill plot ?
> 
> Hi Lin,
> You can always do an overlay where you create two images:
> 1) Create a RasterFill plot with colors. (You already have this plot.)
> 2) Create a RasterFill plot with pattern fill (not color fill).
> 
> Then you would overlay 2) on 1) using the overlay procedure. 
> 
> See example #10 here:
> http://www.ncl.ucar.edu/Applications/overlay.shtml#ex10
> 
> Note that for plot 2) (or plot_shade in example 10) you would want to set the following resources:
> res at cnFillPattern = 3  
> res at cnMonoFillColor = True
> res at lbLabelBarOn = False    ; no labelbar needed
> 
> Available fill patterns:
> http://www.ncl.ucar.edu/Document/Graphics/Images/fillpatterns.png
> 
> Hope that helps. If not, please respond to ncl-talk.
> Adam
> 
> 
> 
> 
>> On Fri, Aug 21, 2015 at 8:44 AM, xianglin72 <xianglin72 at icloud.com> wrote:
>> Hi, all
>> 
>>      I've made a raster fill plot ( see the attachment), and I want to add some FillPattern effect for some chosen cells in the plot.
>> 
>> However, I found that the resource of cnFillPattern can not work for the raster fill plot.    How could I do to add some effect, 
>> 
>> for example, some oblique lines to the chosen rectanglar cells?    
>> 
>> 
>> Thanks
>> 
>> 
>> Lin
>> 
>> _______________________________________________
>> 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
> 
> <test2.eps>
> <dtr_sat_raster.ncl>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150822/196b77b4/attachment.html 


More information about the ncl-talk mailing list