Re: why is the edge in raster fill plot so blurred?

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Thu Jun 05 2014 - 16:17:38 MDT

Hi Xiuzhen,

The quick fix is to add this line to your script:

res_ct@cnMissingValFillColor = "white"

I think the problem is that the old workstation types do not understand transparency in colors. In NCL 6.2 now that transparency is enabled for raster fill,
the default missing value color was changed to fully transparent black ((0,0,0,0) in RGBA terms). Since the old drivers only see three of those values (RGB)
and not the A (alpha -- or opacity) component, it looks like solid black to them.

Sorry for the lack of backwards compatibility in this case. We could have used fully transparent white instead and maybe we still should in order to restore the
compatibility for the old drivers.
 -dave

On Jun 5, 2014, at 2:55 PM, Xiuzhen Ren <xiuzhenren@gmail.com> wrote:

> This is a followup regarding blurred edge in raster fill plot. The solution so far is to use 'oldpdf' intead of 'pdf' as the workstation type.
>
>
> http://www.ncl.ucar.edu/Support/talk_archives/2013/0370.html
>
>
> But this solution causes the change of filling color for _FillValue from the default 'white' color to 'black' color.
>
> Below is a script I have modified from the original thread to illustrate this problem.
>
> Is there any quick fix to change the fill color from 'black' to 'white', thanks!
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
> begin
> nx = 5
> ny = 5
> data = new( (/ny, nx/), float)
>
>
> do i = 0, nx-1
> do j = 0, ny-1
> data(j,i) = rand()
> end do
> end do
>
> data@_FillValue = 1e35
>
> data(1:2,1:2) = 1e35
>
> wks = gsn_open_wks( "oldpdf", "./test") ;plotdir+"/"+varname)
> res_ct = True
>
> res_ct@cnFillOn = True
> res_ct@cnLinesOn = False
> res_ct@cnFillMode = "RasterFill"
> res_ct@lbOrientation = "vertical"
> res_ct@gsnSpreadColors = True
> plot = gsn_csm_contour( wks, data, res_ct)
> end
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jun 05 16:17:49 2014

This archive was generated by hypermail 2.1.8 : Sat Jun 07 2014 - 11:03:12 MDT