Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fdadd63

Browse files
committed
FIX: make sure nbagg figure are shown when created
Removing the `draw_if_interactive` from `pyplot.figure` in b2fbae7 causes the figures to no longer be shown on creation in nbagg, this special-cases the manager creating in nbagg to ensure that the figure is indeed shown. The root cause of this is that unlike every other backend which call `show` in either the Manager `__init__` or one of the `new_figure_manager` functions, nbagg did not
1 parent b0b49cb commit fdadd63

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/matplotlib/backends/backend_nbagg.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ def new_figure_manager_given_figure(num, figure):
224224
if rcParams['nbagg.transparent']:
225225
figure.patch.set_alpha(0)
226226
manager = FigureManagerNbAgg(canvas, num)
227+
if is_interactive():
228+
manager.show()
229+
figure.canvas.draw_idle()
227230
return manager
228231

229232

0 commit comments

Comments
 (0)