MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / destroy

Method destroy

lib/matplotlib/_pylab_helpers.py:45–68  ·  view source on GitHub ↗

Destroy manager *num* -- either a manager instance or a manager number. In the interactive backends, this is bound to the window "destroy" and "delete" events. It is recommended to pass a manager instance, to avoid confusion when two managers share the same

(cls, num)

Source from the content-addressed store, hash-verified

43
44 @classmethod
45 def destroy(cls, num):
46 """
47 Destroy manager *num* -- either a manager instance or a manager number.
48
49 In the interactive backends, this is bound to the window "destroy" and
50 "delete" events.
51
52 It is recommended to pass a manager instance, to avoid confusion when
53 two managers share the same number.
54 """
55 if all(hasattr(num, attr) for attr in ["num", "destroy"]):
56 # num is a manager-like instance (not necessarily a
57 # FigureManagerBase subclass)
58 manager = num
59 if cls.figs.get(manager.num) is manager:
60 cls.figs.pop(manager.num)
61 else:
62 try:
63 manager = cls.figs.pop(num)
64 except KeyError:
65 return
66 if hasattr(manager, "_cidgcf"):
67 manager.canvas.mpl_disconnect(manager._cidgcf)
68 manager.destroy()
69
70 @classmethod
71 def destroy_fig(cls, fig):

Callers 3

closeFunction · 0.45
destroy_figMethod · 0.45
destroy_allMethod · 0.45

Calls 3

mpl_disconnectMethod · 0.80
getMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected