Re: color of the value

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Aug 21 2012 - 09:39:58 MDT

Dear JinQ,

You are using a color that is not in the OceanLakeLandSnow color map.

In order to used named colors like "red" with NCL versions 6.0.0 or earlier, they either have to already be part of your color map, or you have to add them with NhlNewColor.

Unfortunately, since the "OceanLakeLandSnow" color map already has 256 colors, you can't add any more colors to it.

There are a couple of solutions:

  1. Upgrade to NCL V6.1.0-beta. In this version, named colors will work regardless if they are in your color map or not.

  2. Use NhlSetColor to replace one of the colors in OceanLakeLandSnow with red. My recommendation is to replace the last color, since it is white and you already have white:

     NhlSetColor(wks,255,1.0,0.,0.)

If you go with #2, you have to be careful that any filled contour plots don't use this last color as part of the color scheme. You can do this with:

   res@gsnSpreadColorEnd = -2 ; this is second-to-last-color

However, I noticed for your filled contour plot, you already have:

   res@gsnSpreadColorEnd = 225

so you should be okay there.

--Mary

On Aug 21, 2012, at 7:46 AM, JinQ Liu wrote:

> I dont want to change the color map, so I use the second solution, but it seems not work.
> The code is in attachment. Please help me to check it. Thanks in advance.
>
> --
> JinQing LIU M.S.
> Ocean University of China
> --
>
>
>
> At 2012-08-06 22:35:00,"Mary Haley" <haley@ucar.edu> wrote:
> >Hi JinQ,
> >
> >Setting cnLineColor should work. If you are not seeing red, *and* you have NCL version 6.0.0 or earlier, then my guess is that you have
> >loaded a color map that doesn't have red in it. In older versions of NCL, you need to have the named color in your color
> >map, or else it will just use the closest thing it can find.
> >
> >You have two options:
> >
> > 1. Use a color map that has red in it:
> >
> >http://www.ncl.ucar.edu/Document/Graphics/color_table_gallery.shtml
> >
> >
> > 2. Add red to your color map with:
> >
> > i = NhlNewColor(wks,1.0,0,0)
> >
> >If neither of these work, then I will need to see at least the graphics part of your code in order to debug this.
> >
> >--Mary
> >
> >
> >On Aug 4, 2012, at 3:12 AM, JinQ Liu wrote:
> >
> >> hi,
> >> I use resT@cnLineColor = "Red" to change the color of the contour line, but the value on the line are still black,
> >> how can i change the value to "Red" ?
> >>
> >> Thanks in advance!!
> >>
> >> JinQ
> >> --
> >> JinQing LIU M.S.
> >> Ocean University of China
> >> --
> >>
> >>
> >>
> >> _______________________________________________
> >> ncl-talk mailing list
> >> List instructions, subscriber options, unsubscribe:
> >> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >
>
>
>
> <t.ncl>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Aug 21 09:40:06 2012

This archive was generated by hypermail 2.1.8 : Thu Aug 23 2012 - 16:16:15 MDT