28

In an earlier question I learned that the behavior on show() was dependent on the backend in use by matplotlib. At that time I was looking for a way to keep show() from deleting the drawing elements of a figure, concluding that by switching from Qt4Agg to TkAgg, the drawing elements would be preserved even if the figures were closed. I would like to increase my superpowers by learning, if possible, how to configure the Qt4agg backend to behave as desired.

Community
  • 1
  • 1
2NinerRomeo
  • 2,687
  • 4
  • 29
  • 35
  • 3
    Specific questions about matplotlib (or any particular package) are probably best put to a suitable mailing list - after looking at the documentation for answers. For matplotlib, the -users list is here: https://sourceforge.net/mailarchive/forum.php?forum_name=matplotlib-users – Thomas K May 18 '11 at 21:07
  • 3
    Then why do we have a "matplotlib" tag? – Adrian Ratnapala Oct 11 '11 at 10:04
  • I guess "best" just meant that you have a higher change of getting answer from the devs -- in case they are not addicted to SO yet. – eudoxos Nov 03 '11 at 22:08

1 Answers1

2

Instead of trying to exercise extra control over the backend, just create the figures and keep references to them yourself, as shown in the highest-rated answer to your first question. The problem with trying to manipulate the backend, as you are asking to do here, is that the backend is not intended to hand your figures back to you intact once you have looked at them; that's not normally the backend's job. See: matplotlib figures disappearing between show() and savefig()

Community
  • 1
  • 1
Brandon Rhodes
  • 83,755
  • 16
  • 106
  • 147