Re: using different colormap in panel plot

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon, 2 Apr 2007 11:08:29 -0600 (MDT)

Ufuk,

Try setting:

    res.nglSpreadColors = False

This should turn off the default behavior of trying to use the full
colormap when coloring contours.

--Mary

On Mon, 2 Apr 2007, [BE] Ufuk Utku Turuncoglu wrote:

> Hi,
>
> I have just solve the some missing function problems and run my pyngl scripts
> but it fails again. when i plot the all figures without panel plots (using
> draw and frame true) in same wks using following commands,
>
> define_colormap(wks,"WhViBlGrYeOrRe")
> Ngl.contour_map(wks, var1ave, res)
> Ngl.contour_map(wks, var2ave, res)
> Ngl.contour_map(wks, var3ave, res)
> define_colormap(wks,"BlWhRe")
> Ngl.contour_map(wks, diff1ave, res)
>
> it plots successfully as i want. but using panel plots i could not control
> the colors that is used in contour fill. I specify the color using, for
> example
>
> res.cnFillColors = range(2,103)
>
> command, pyngl does not use the specified colors and use all colormap. i also
> specify the colors using res.cnFillColors = [......some color numbers.....]
> but it fails too. I control the merged colormap using print cmap[:] and
> Ngl.draw_colormap(wks) commands and they seems ok.
>
> best wishes
>
> Ufuk
>
>
>
>
>
> Mary Haley wrote:
>> 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
Received on Mon Apr 02 2007 - 11:08:29 MDT

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