Re: Fwd: colors not displayed

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Mar 17 2010 - 13:35:18 MDT

Rosa,

In order to use a named color, it must be in your color map. If you
are loading the "rainbow" colormap, for example, and try to use
"pink" for some color resource, you won't get pink, but rather you'll
get a color in your current color map that is closest to pink (white,
in this case).

To make sure you have pink in your color map, you can use
gsn_merge_colormaps to merge the color map you want, along with the
list of named colors you also want. Here's an example:

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

begin
   x = (/10.,20.,30.,40.,50.,60.,70.,80.,90./)
   y = (/0.,0.71,1.,0.7,0.002,-0.71,-1.,-0.71,-0.003/)

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

   res = True
   res@xyLineColor = "pink"
   res@xyLineThicknessF = 3.0

; Line will be white, not pink.
   plot = gsn_xy(wks,x,y,res)

   gsn_merge_colormaps(wks,"rainbow",(/"pink","orange"/))
; gsn_draw_colormap(wks)

; Now pink should show up.
   plot = gsn_xy(wks,x,y,res)
end

On Mar 17, 2010, at 1:12 PM, rosatrancoso wrote:

> Hi,
>
> I have ncl version 5.1.1 running on a HP laptop with opensuse 11.2
> 64bits (2.6.31.5-0.1-desktop).
> Most of the colors specified are not plotted (e.g. "Pink", or its
> RGB equivalent). These colors are the displayed with functions
> "gsn_draw_named_colors" but not with "gsn_contour" or "gsn_csm_xy".
> In the known bugs there's a reference to a difference between the
> colors in the graphic and in the label, but this is not the case.
> How can I display these colors?
>
> ncl -V
> 5.1.1
>
> uname -a
> Linux Lana 2.6.31.5-0.1-desktop #1 SMP PREEMPT 2009-10-26 15:49:03
> +0100 x86_64 x86_64 x86_64 GNU/Linux
>
> Best regards
> Rosa
>
>
> <test_colors.ncl><uv300.nc><plt_test_colors.ps>
> _______________________________________________
> 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 Wed Mar 17 13:36:37 2010

This archive was generated by hypermail 2.1.8 : Fri Mar 19 2010 - 16:19:08 MDT