[ncl-talk] gsn_contour_shade

Adam Phillips asphilli at ucar.edu
Tue Aug 21 21:38:10 MDT 2018


Hello,
gsn_contour_shade simply color fills contours of the existing contour field. If you call it twice for the same plot, it will replace the color filled contours from the 1st call to gsn_contour_shade with those specified in the second call. 

You have two options: 
1) create two versions of wspeedfill, call gan_contour_shade for each, and then overlay.
2) Do not use gsn_contour_shade and specify the fill colors using the cnFillColors resource, setting most colors to transparent and two colors to grey. 
Hope that helps! If you have further questions let ncl-talk know.
Adam

> On Aug 21, 2018, at 7:34 PM, Rick Brownrigg <brownrig at ucar.edu> wrote:
> 
> Hi,
> 
> Very hard to say with the information provided. The examples cited at the bottom of the description of gsn_contour_shade show how to do multiple shades:
> 
>    http://ncl.ucar.edu/Document/Graphics/Interfaces/gsn_contour_shade.shtml
> 
> In general, they involve setting the resources gsnDraw and gsnFrame to False, doing your gsn_contour_shade() calls, and then calling
> 
>   draw(plot)
>   frame(wks)
> 
> to draw everything.
> 
> If those examples don't help, you might write back with more of your script to help others trouble shoot.  I hope that helps...
> 
> Rick
> 
>> On Tue, Aug 21, 2018 at 5:29 PM, yang yang <yang.yang816 at gmail.com> wrote:
>> Dear All:
>> 
>> I would like to plot two shade areas in a diagram using the codes below:
>> 
>>   wspeedfill    = gsn_csm_contour(wks,ptt,wspeed_res)
>> opt = True
>>   opt at gsnShadeMid = "grey"
>>  wspeedfill = gsn_contour_shade(wspeedfill,315.,330.,opt)
>> draw(wspeedfill)
>> opt1 = True
>> opt1 at gsnShadeMid = "grey"
>> wspeedfill = gsn_contour_shade(wspeedfill,340.,355.,opt1)
>> 
>> However, only one shade area (340.,355.) was plotted. Can you please tell me how to fix this problem?
>> 
>> Thanks very much!
>> 
>> Regards
>> Ed
>> 
>> 
>> _______________________________________________
>> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180821/68eb679d/attachment.html>


More information about the ncl-talk mailing list