Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ed45612

Browse filesBrowse files
authored
Merge pull request #23912 from tacaswell/fix_pycharm_interagg
FIX: only expect FigureCanvas on backend module if using new style
2 parents df69d4f + 0d37358 commit ed45612
Copy full SHA for ed45612

File tree

Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed

‎lib/matplotlib/pyplot.py

Copy file name to clipboardExpand all lines: lib/matplotlib/pyplot.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ def switch_backend(newbackend):
263263

264264
backend_mod = importlib.import_module(
265265
cbook._backend_module_name(newbackend))
266-
canvas_class = backend_mod.FigureCanvas
267266

268267
required_framework = _get_required_interactive_framework(backend_mod)
269268
if required_framework is not None:
@@ -293,6 +292,8 @@ class backend_mod(matplotlib.backend_bases._Backend):
293292
# also update backend_mod accordingly; also, per-backend customization of
294293
# draw_if_interactive is disabled.
295294
if new_figure_manager is None:
295+
# only try to get the canvas class if have opted into the new scheme
296+
canvas_class = backend_mod.FigureCanvas
296297
def new_figure_manager_given_figure(num, figure):
297298
return canvas_class.new_manager(figure, num)
298299

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.