|
From: Eric F. <ef...@ha...> - 2005-02-22 04:14:50
|
Perry, John,
Progress! I found that the problem I was having with PolyCollection was
this: the vertices argument must be a sequence (list or tuple) of tuples
of tuples--if one gives it a list of *lists* of tuples, one gets
[first part of trace omitted]
File "/usr/lib/python2.3/site-packages/matplotlib/collections.py",
line 205, in draw
self._offsets, self._transOffset)
TypeError: CXX: type error
(The line number was smaller before I put in some debugging print
statements.)
I think this fussiness qualifies as a bug; the docstring for
PolyCollection says vertices can be a sequence of sequences of tuples.
I don't know what the right way to fix it is, however, so I am working
around it.
Having solved that problem, I am getting more optimistic about being
able to come up with a usable filled contour capability fairly quickly.
Still no promises, though.
All this brings to mind a question that has puzzled me for a long time:
why does matplotlib internally use sequences of (x,y) tuples instead of
numerix arrays--either a 2-D array, or a pair (or tuple) of 1-D arrays?
I would think that running all plotted numbers through the conversion
from arrays to Python tuples, and then from there into the native data
types for each backend, would incur a big performance penalty when
plotting large numbers of points. Not that I am suggesting a
redesign--I am just curious.
Eric
|