8

I would like to call the draw() function of a matplotlib Spine instance. The documentation for Spines shows that draw() needs a 'renderer' parameter:

draw(self, renderer)

Code documentation for Renderers is nonexistent, as far as I can tell. All references to them as a class, like matplotlib.backend_bases.Renderer on the Artist page, don't provide links. Searching turns up nothing but a table of renderers on the Usage FAQ page. This tells me the names of the common renderers, but nothing about how to obtain a reference to one. I've searched for a get_renderer() function in the docs, but it's turned up nothing so far.

How do I obtain a reference to a renderer in order to use the spines.draw() function?

Darien Marks
  • 446
  • 4
  • 18
  • 3
    Depending on the backend and any potential previous draw there may be a renderer available through `fig.canvas.renderer`, but it's unsafe to rely on it being present. The `draw()` function of individual artists is not actually meant to be called by the user in general, so maybe you want to get more into detail about why you think you need the renderer. – ImportanceOfBeingErnest Mar 14 '20 at 00:17
  • You're right, `fig.canvas.renderer` is not available to me. "Not meant to be called by the user" is probably the best answer to this question, then, I guess. Why I'm trying to call `draw()` is best posted as a separate question, so I'll do that. Thanks! – Darien Marks Mar 14 '20 at 00:46

0 Answers0