diff --git a/ipympl/backend_nbagg.py b/ipympl/backend_nbagg.py index 15813bba..e740cef8 100644 --- a/ipympl/backend_nbagg.py +++ b/ipympl/backend_nbagg.py @@ -452,11 +452,13 @@ def handle_key(key): class FigureManager(FigureManagerWebAgg): - ToolbarCls = Toolbar + if matplotlib.__version__ < "3.6": + ToolbarCls = Toolbar def __init__(self, canvas, num): FigureManagerWebAgg.__init__(self, canvas, num) self.web_sockets = [self.canvas] + self.toolbar = Toolbar(self.canvas) def show(self): if self.canvas._closed: