(figure)
| 95 | |
| 96 | |
| 97 | def 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 | |
| 117 | def _setup_gtk(tb): |
nothing calls this directly
no test coverage detected
searching dependent graphs…