Re: Ngl.add_text support arrays?

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri, 12 Jun 2009 09:42:40 -0600 (MDT)

Hi Daryl,

You're correct, Ngl.add_text doesn't support multiple strings!
You have to loop through them.

I'll correct the documentation (the same is true for Ngl.text_ndc
and Ngl.text).

Sometime we'll try to upgrade these to handle multiple arrays.

--Mary

On Fri, 12 Jun 2009, daryl herzmann wrote:

> Greetings,
>
> The PyNgl documentation suggests Ngl.add_text supports arrays/lists ...
>
> http://www.pyngl.ucar.edu/Functions/Ngl.add_text.shtml
>
> but does it? :) I have included a simple case of my attempted use.
>
> thanks!
> daryl
>
> import numpy, Ngl
> print Ngl.__version__
> x = numpy.array(range(0,101))
> y = numpy.sin(0.0628*x)
> wks = Ngl.open_wks("ps","basic")
> plot = Ngl.y(wks,y)
>
> ta = ['Blah', 'Blah', 'Blah']
> xa = [10, 30, 50]
> ya = [-0.2, 0.0, 0.2]
>
> Ngl.add_text(wks,plot,ta,xa,ya)
> Ngl.end()
>
> ==== Results
>
> 1.3.0b1
> Traceback (most recent call last):
> File "text.py", line 12, in <module>
> Ngl.add_text(wks,plot,ta,xa,ya)
> File "...python2.5/site-packages/PyNGL/Ngl.py", line 1675, in add_text
> tx_rlist,am_rlist, pvoid())
> TypeError: in method 'add_text_wrap', argument 3 of type 'NhlString'
>
> _______________________________________________
> pyngl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>
_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Fri Jun 12 2009 - 09:42:40 MDT

This archive was generated by hypermail 2.2.0 : Tue Jun 16 2009 - 10:06:42 MDT