Re: cyclic colormap

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue, 26 May 2009 09:38:29 -0600 (MDT)

Hi Bruce,

The "cyclic" color map does have a black background and a white
foreground. Actually, I think it doesn't explicitly set the
background/foreground colors; it uses the internal NCL default, which
is a black background, white foreground.

I think what is happening in your case is that you probably have a
".hluresfile" file in your home directory that is swapping the
foreground/background colors with:

! White background/black foreground
*wkForegroundColor : (/0.,0.,0./)
*wkBackgroundColor : (/1.,1.,1./)

These resources are explicitly defining the background and foreground
colors to white and black respectively.

If you have a .hluresfile that sets the above and you want to keep
the black background, then see this sample script:

load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl"

begin
   cdf_file = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/contour.cdf","r")
   temp = cdf_file->T(0,0,:,:)

   wks = gsn_open_wks("x11","test")
   gsn_define_colormap(wks,"cyclic")

; Force a black background, white foreground, to override
; setting in ".hluresfile".
   setvalues wks
     "wkForegroundColor" : (/1.,1.,1./) ; white
     "wkBackgroundColor" : (/0.,0.,0./) ; black
   end setvalues

   res = True
   res_at_cnFillOn = True
   plot = gsn_contour(wks,temp,res)
end

On Tue, 26 May 2009, Lunde, Bruce N CIV NAVOCEANO, NP1 wrote:

> Hello,
>
> A small issue: The "cyclic" colormap defines
> white to have index 0 and black to have
> index 1.
>
> The web page has the opposite (black=1 and
> white=0). See
> http://www.ncl.ucar.edu/Document/Graphics/ColorTables/cyclic.shtml
>
> Thanks, Bruce
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue May 26 2009 - 09:38:29 MDT

This archive was generated by hypermail 2.2.0 : Tue May 26 2009 - 10:17:16 MDT