|
From: John H. <jdh...@ac...> - 2004-11-16 16:14:31
|
>>>>> "Chris" == Chris <bi...@Fu...> writes:
Chris> I tried with what you suggested to make an Arrow class. To
Chris> begin with, I only put an Line2D instance. I searched for
Chris> table stuff in axes.py, matlab.py to make the arrow
Chris> importable from matplotlib.matlab. Then I also try a very
Chris> very simple demo and I expect to see a simple
Chris> line. However, I can not see it. Could someone tell me what
Chris> is the problem. Here is my very very rudimental codes.
Nowhere in your code do you actually draw the arrows in self.arrows.
In Axes.draw you would need to do
for arrow in self.arrows:
arrow.draw(renderer)
And this should work.
However, you can avoid all the overhead of add_arrow, and keeping a
list of arrows in self.arrows simply by doing
def arrow(self, x, y, *args, **kwargs):
a = Arrow(x,y, *args, **kwargs)
self.add_artist(a)
^^^
return a
Ie, call add_artist which is a generic method for adding artists to
the axes.
Hope this helps,
JDH
|