[ncl-talk] problem of gsn_contour_shade when output epsi

Mary Haley haley at ucar.edu
Fri May 13 09:15:46 MDT 2016


Jian,

Thanks for the script.

The problem is that gsn_contour_shade is using missing values for some of
the contour color fill, and for whatever reason, the EPSI output renders
this in black, while all other output formats render this in white.

I've fixed gsn_contour_shade so that it doesn't use missing values for
color.  If you have permissions to edit
$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl, then you can fix this
yourself.

All you need to do is add one line of code (see the "HERE'S THE FIX" line)

;---Create array for fill, set all to transparent or white
   if(shade_type.eq."color") then
     colist      = new((/N+1,4/),double)
     colist      = 1.                        ; HERE'S THE FIX
     colist(:,3) = 0.
   else
     colist = new(N+1,integer)
     colist = -1
   end if

If you can't modify gsn_code.ncl yourself, then you can use the attached
fix for gsn_contour_shade.  You will need to load this script after you
load gsn_code.ncl:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "gsn_contour_shade_fix.ncl"


As another work-around, you can set gsnShadeLow to white for all colors
below the desired level.

--Mary




On Wed, May 11, 2016 at 4:26 AM, Jian Zheng <jzheng8606 at gmail.com> wrote:

> Hi,
>
> Attached are the script, the epsi and eps figures.
>
> Best wishes,
> Jian
>
> On Wed, May 11, 2016 at 1:45 AM, Mary Haley <haley at ucar.edu> wrote:
>
>> This is likely an EPSI issue, and not gsn_contour_shade problem.
>>
>> Can you provide a short script that illustrates the problem?
>>
>> Thanks,
>>
>> --Mary
>>
>>
>> On Tue, May 10, 2016 at 7:49 AM, Jian Zheng <jzheng8606 at gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I usually output my ncl plot into epsi format, because eps has much
>>> blank space around the plot. Today when I used gsn_contour_shade to mask
>>> contours higher than a value in my contour plot, the contours lower than
>>> the value are filled with black. This happened for epsi output, but it
>>> worked well for eps or x11 output. I am wondering where does this problem
>>> come from, gsn_contour_shaded or epsi format?
>>>
>>> My ncl version is 6.3.0.
>>>
>>> Thanks,
>>> Jian
>>>
>>> _______________________________________________
>>> 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/20160513/b59b086b/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gsn_contour_shade_fix.ncl
Type: application/octet-stream
Size: 7955 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160513/b59b086b/attachment.obj 


More information about the ncl-talk mailing list