File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -1185,9 +1185,16 @@ def _setup_blit(self):
1185
1185
# Setting up the blit requires: a cache of the background for the Axes
1186
1186
self ._blit_cache = dict ()
1187
1187
self ._drawn_artists = []
1188
+ # _post_draw needs to be called first to initialize the renderer
1189
+ self ._post_draw (None , self ._blit )
1190
+ # Then we need to clear the Frame for the initial draw
1191
+ # This is typically handled in _on_resize because QT and Tk
1192
+ # emit a resize event on launch, but the macosx backend does not,
1193
+ # thus we force it here for everyone for consistency
1194
+ self ._init_draw ()
1195
+ # Connect to future resize events
1188
1196
self ._resize_id = self ._fig .canvas .mpl_connect ('resize_event' ,
1189
1197
self ._on_resize )
1190
- self ._post_draw (None , self ._blit )
1191
1198
1192
1199
def _on_resize (self , event ):
1193
1200
# On resize, we need to disable the resize event handling so we don't
Original file line number Diff line number Diff line change @@ -1294,6 +1294,8 @@ - (void)updateDevicePixelRatio:(double)scale
1294
1294
goto exit ;
1295
1295
}
1296
1296
if (PyObject_IsTrue (change)) {
1297
+ // Notify that there was a resize_event that took place
1298
+ gil_call_method (canvas, " resize_event" );
1297
1299
[self setNeedsDisplay: YES ];
1298
1300
}
1299
1301
You can’t perform that action at this time.
0 commit comments