@@ -361,12 +361,10 @@ def finish(self):
361
361
def grab_frame (self , ** savefig_kwargs ):
362
362
# docstring inherited
363
363
_log .debug ('MovieWriter.grab_frame: Grabbing frame.' )
364
- # re-adjust the figure size in case it has been changed by the
365
- # user. We must ensure that every frame is the same size or
366
- # the movie will not save correctly.
364
+ # Readjust the figure size in case it has been changed by the user.
365
+ # All frames must have the same size to save the movie correctly.
367
366
self .fig .set_size_inches (self ._w , self ._h )
368
- # Tell the figure to save its data to the sink, using the
369
- # frame format and dpi.
367
+ # Save the figure data to the sink, using the frame format and dpi.
370
368
self .fig .savefig (self ._frame_sink (), format = self .frame_format ,
371
369
dpi = self .dpi , ** savefig_kwargs )
372
370
@@ -1113,10 +1111,12 @@ def func(current_frame: int, total_frames: int) -> Any
1113
1111
"frame size to vary, which is inappropriate for "
1114
1112
"animation." )
1115
1113
# canvas._is_saving = True makes the draw_event animation-starting
1116
- # callback a no-op.
1114
+ # callback a no-op; canvas.manager = None prevents resizing the GUI
1115
+ # widget (both are likewise done in savefig()).
1117
1116
with mpl .rc_context ({'savefig.bbox' : None }), \
1118
1117
writer .saving (self ._fig , filename , dpi ), \
1119
- cbook ._setattr_cm (self ._fig .canvas , _is_saving = True ):
1118
+ cbook ._setattr_cm (self ._fig .canvas ,
1119
+ _is_saving = True , manager = None ):
1120
1120
for anim in all_anim :
1121
1121
anim ._init_draw () # Clear the initial frame
1122
1122
frame_number = 0
0 commit comments