From: John H. <jdh...@ac...> - 2004-06-23 12:14:15
|
>>>>> "Philippe" == Philippe Bouige <pb...@pa...> writes: Philippe> Hello, Philippe> I try 'vline_demo' in directory 'example' and I have Philippe> problem with vlines ... error : "rank-O array has no Philippe> length". I try also with hlines and I have the same Philippe> problem ... Philippe> I also this error with all the demo : error reading Philippe> package index file C:/Python23/tcl/tix8.1/pkgIndex.tcl: Philippe> invalid command name "lt}]}" Philippe> Have you a explanation ? This turns out to be numarray specific - most of my tests use Numeric which is why I didn't catch that. I'll try and make sure I do a numarray specific test in the future. Todd, perhaps you should also make a note to run backend_driver on your numarray build, at least for Agg. That wouldn't have helped this time, because vline_demo.py was not in the regression suite, but I've added it. Now on to your problem. This is caused by a difference in how Numeric and numarray treak rank 0 arrays >>> from Numeric import asarray >>> len(asarray(0)) 1 >>> from numarray import asarray >>> len(asarray(0)) Traceback (most recent call last): File "<stdin>", line 1, in ? ValueError: Rank-0 array has no length. I don't know why there is this difference but I'm sure Todd or Perry can comment at length :-). To solve your vline problem, you need to make the vmin and vmax args of vlines (or hlines) iterable. Ie old vlines(t, 0, s, color='k') new vlines(t, [0], s, color='k') Should work! Thanks for letting us know. John Hunter |