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

Function setup

galleries/examples/user_interfaces/mplcvd.py:97–114  ·  view source on GitHub ↗
(figure)

Source from the content-addressed store, hash-verified

95
96
97def setup(figure):
98 tb = figure.canvas.toolbar
99 if tb is None:
100 return
101 for cls in type(tb).__mro__:
102 pkg = cls.__module__.split(".")[0]
103 if pkg != "matplotlib":
104 break
105 if pkg == "gi":
106 _setup_gtk(tb)
107 elif pkg in ("PyQt5", "PySide2", "PyQt6", "PySide6"):
108 _setup_qt(tb)
109 elif pkg == "tkinter":
110 _setup_tk(tb)
111 elif pkg == "wx":
112 _setup_wx(tb)
113 else:
114 raise NotImplementedError("The current backend is not supported")
115
116
117def _setup_gtk(tb):

Callers

nothing calls this directly

Calls 4

_setup_gtkFunction · 0.85
_setup_qtFunction · 0.85
_setup_tkFunction · 0.85
_setup_wxFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…