Re: using different colormap in panel plot

From: Fred Clare <fred_at_nyahnyahspammersnyahnyah>
Date: Sun, 1 Apr 2007 01:36:10 -0600

On Mar 31, 2007, at 7:39 AM, turuncu_at_be.itu.edu.tr wrote:

> hi,
>
> now, i did not find "get_MDfloat_array" function from NCL. It give
> error
> message as,
>
> NameError: global name 'find . -exec grep ' is not defined
>
> how can i found these function from NCL. Which directory of the NCL
> installation holds these functions?

Since this post is to PyNGL talk, I am assuming that you are
concerned with PyNGL and not NCL.

get_MDfloat_array is in the PyNGL Ngl module. See:

http://www.pyngl.ucar.edu/Functions/Ngl.get_MDfloat_array.shtml

The color2 example shows a usage.

If you did an:

import Ngl

and not:

from Ngl import *

to use get_MDfloat_array you will have to qualify it like:

Ngl.get_MDfloat_array

Fred Clare

>
> thanks,
>
> ufuk
>
>> Sure, it's a pretty short function, 10 lines:
>>
>> def retrieve_colormap(wks):
>> """
>> Retrieves the current color map associated with the given workstation
>> and returns a 2-dimensional Numeric array of RGB values.
>>
>> cmap = Ngl.retrieve_colormap(wks)
>>
>> wks -- The identifier returned from calling Ngl.open_wks.
>> """
>> return get_MDfloat_array(wks,"wkColorMap")
>>
>>
>> --Mary
>>
>>
>> On Fri, 30 Mar 2007, [BE] Ufuk Utku Turuncoglu wrote:
>>
>>> Hi,
>>>
>>> I add the merge script but when i run my plot script it gives the
>>> following
>>> error,
>>>
>>> Traceback (most recent call last):
>>> File "plot_diff.py", line 180, in ?
>>> merge_colormaps(wks,"BlWhRe","gui_default")
>>> File "plot_diff.py", line 98, in merge_colormaps
>>> orig_cmap = retrieve_colormap(wks)
>>> NameError: global name 'retrieve_colormap' is not defined
>>>
>>> I think, "retrieve_colormap" function also is not exist in pyngl.
>>> could
>>> you
>>> send me?
>>>
>>> Best wishes
>>>
>>> Ufuk
>>>
>>>
>>
>
>
> _______________________________________________
> pyngl-talk mailing list
> pyngl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk

_______________________________________________
pyngl-talk mailing list
pyngl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Sun Apr 01 2007 - 01:36:10 MDT

This archive was generated by hypermail 2.2.0 : Tue Apr 17 2007 - 15:42:04 MDT