Re: NhlNewColor accept array argument

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Jul 21 2011 - 16:00:27 MDT

I agree Bruce! Unfortunately, we don't have optional argument capability in NCL, so you can't have NhlNewColor accept either 4 arguments (wks, r,g,b) versus two arguments (wks,(/r,g,b/)).

I'll add it to our list to create supplement functions that are more user friendly, maybe simply:

   i = newcolor(wks,(/r,g,b/))

You can certainly write your own using an NCL scripts. See the attached "new_color.ncl" and the "new_color_test.ncl" that calls it.
You can even choose for "new_color" to be a procedure instead of a function, if you don't need the return values.

--Mary

On Jul 21, 2011, at 8:46 AM, Lunde, Bruce N CIV NAVOCEANO, NP1 wrote:

> Just a suggestion for the "todo" list:
>
> It would be nice if NhlNewColor would also accept an
> input array as an argument:
>
> newindex = NhlNewColor( wks, (/0.8,0.4,0.8/) )
>
> or
>
> newindex = NhlNewColor( wks, someColorMap(102,:) )
>
> where someColorMap is Nx3
>
> Thanks, Bruce
> _______________________________________________
> 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 Jul 21 16:00:32 2011

This archive was generated by hypermail 2.1.8 : Fri Jul 29 2011 - 08:44:18 MDT