On Tue, Mar 31, 2009 at 3:33 AM, Matthias Michler
<matthiasmich...@gmx.net> wrote:
>
> Hello,
>
> I'm not familiar with  the draw_artist functionality, but for me there seems
> to to be the following replacement needed (due to a typo):
>
> self.ax.draw_artist(plt.contourf) -> self.ax.draw_artist(self.contour)
>
> because otherwise you are trying to draw a matplotlib function, which seems to
> be not reasonable and explains the error, because this function has no
> attribute 'draw'.

Yes, that looks like the problem, but not the solution.  self.contour
is the return value of ax.contourf, which is a ContourSet.
Unfortunately, the matplotlib.contour documentation has not yet been
ported to the sphinx/rest doc system (Eric, hint, hint).  But you can
read the docs in the source of matplotlib/contour.py or in the python
shell with help matplotlib.countour.ContourSet.  To do what it looks
like you are trying to do, if you want to force a draw on the contour
artists (which are matplotlib.collection.Collection instances), you
would do

  self.contour = ax.contourf(...)
  for col in self.contour.collections:
    ax.draw_artist(col)

JDH

------------------------------------------------------------------------------
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to