From: Jae-Joon L. <lee...@gm...> - 2010-02-09 16:51:43
|
Figure.draw_artist is just a convenience function. def draw_artist(self, a): """ draw :class:`matplotlib.artist.Artist` instance *a* only -- this is available only after the figure is drawn """ assert self._cachedRenderer is not None a.draw(self._cachedRenderer) And, all the drawing is done by the artist itself. > > Also, other atists don't fail in this manner if I don't use artist.set_figure(). > As far as I can see, it only means that you're lucky with other artists. The reason Text artists needs a reference to the figure is to access the dpi value, as the exception indicates. All artists are meant to be added to an axes (or at least "axes", "figure", etc. attributes set appropriately) to work correctly. Regards, -JJ |