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):
11851185 # Setting up the blit requires: a cache of the background for the Axes
11861186 self ._blit_cache = dict ()
11871187 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
11881196 self ._resize_id = self ._fig .canvas .mpl_connect ('resize_event' ,
11891197 self ._on_resize )
1190- self ._post_draw (None , self ._blit )
11911198
11921199 def _on_resize (self , event ):
11931200 # 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
12941294 goto exit;
12951295 }
12961296 if (PyObject_IsTrue (change)) {
1297+ // Notify that there was a resize_event that took place
1298+ gil_call_method (canvas, " resize_event" );
12971299 [self setNeedsDisplay: YES ];
12981300 }
12991301
You can’t perform that action at this time.
0 commit comments