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

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to