@@ -1577,8 +1577,12 @@ class FigureCanvasBase:
15771577 ----------
15781578 figure : `matplotlib.figure.Figure`
15791579 A high-level figure instance
1580-
15811580 """
1581+
1582+ # Set to one of {"qt5", "qt4", "gtk3", "wx", "tk", "macosx"} if an
1583+ # interactive framework is required, or None otherwise.
1584+ required_interactive_framework = None
1585+
15821586 events = [
15831587 'resize_event' ,
15841588 'draw_event' ,
@@ -1654,8 +1658,7 @@ def _fix_ipython_backend2gui(cls):
16541658 # In case we ever move the patch to IPython and remove these APIs,
16551659 # don't break on our side.
16561660 return
1657- backend_mod = sys .modules [cls .__module__ ]
1658- rif = getattr (backend_mod , "required_interactive_framework" , None )
1661+ rif = getattr (cls , "required_interactive_framework" , None )
16591662 backend2gui_rif = {"qt5" : "qt" , "qt4" : "qt" , "gtk3" : "gtk3" ,
16601663 "wx" : "wx" , "macosx" : "osx" }.get (rif )
16611664 if backend2gui_rif :
@@ -3299,10 +3302,6 @@ class _Backend:
32993302 # class FooBackend(_Backend):
33003303 # # override the attributes and methods documented below.
33013304
3302- # Set to one of {"qt5", "qt4", "gtk3", "wx", "tk", "macosx"} if an
3303- # interactive framework is required, or None otherwise.
3304- required_interactive_framework = None
3305-
33063305 # `backend_version` may be overridden by the subclass.
33073306 backend_version = "unknown"
33083307
@@ -3385,14 +3384,15 @@ def show(cls, block=None):
33853384
33863385 @staticmethod
33873386 def export (cls ):
3388- for name in ["required_interactive_framework" ,
3389- "backend_version" ,
3390- "FigureCanvas" ,
3391- "FigureManager" ,
3392- "new_figure_manager" ,
3393- "new_figure_manager_given_figure" ,
3394- "draw_if_interactive" ,
3395- "show" ]:
3387+ for name in [
3388+ "backend_version" ,
3389+ "FigureCanvas" ,
3390+ "FigureManager" ,
3391+ "new_figure_manager" ,
3392+ "new_figure_manager_given_figure" ,
3393+ "draw_if_interactive" ,
3394+ "show" ,
3395+ ]:
33963396 setattr (sys .modules [cls .__module__ ], name , getattr (cls , name ))
33973397
33983398 # For back-compatibility, generate a shim `Show` class.
0 commit comments