(self, renderer)
| 3284 | # Drawing |
| 3285 | @martist.allow_rasterization |
| 3286 | def draw(self, renderer): |
| 3287 | # docstring inherited |
| 3288 | if renderer is None: |
| 3289 | raise RuntimeError('No renderer defined') |
| 3290 | if not self.get_visible(): |
| 3291 | return |
| 3292 | self._unstale_viewLim() |
| 3293 | |
| 3294 | renderer.open_group('axes', gid=self.get_gid()) |
| 3295 | |
| 3296 | # prevent triggering call backs during the draw process |
| 3297 | self._stale = True |
| 3298 | |
| 3299 | # loop over self and child Axes... |
| 3300 | locator = self.get_axes_locator() |
| 3301 | self.apply_aspect(locator(self, renderer) if locator else None) |
| 3302 | |
| 3303 | artists = self.get_children() |
| 3304 | artists.remove(self.patch) |
| 3305 | |
| 3306 | # the frame draws the edges around the Axes patch -- we |
| 3307 | # decouple these so the patch can be in the background and the |
| 3308 | # frame in the foreground. Do this before drawing the axis |
| 3309 | # objects so that the spine has the opportunity to update them. |
| 3310 | if not (self.axison and self._frameon): |
| 3311 | for spine in self.spines.values(): |
| 3312 | artists.remove(spine) |
| 3313 | |
| 3314 | self._update_title_position(renderer) |
| 3315 | |
| 3316 | if not self.axison: |
| 3317 | for _axis in self._axis_map.values(): |
| 3318 | artists.remove(_axis) |
| 3319 | |
| 3320 | if not self.get_figure(root=True).canvas.is_saving(): |
| 3321 | artists = [ |
| 3322 | a for a in artists |
| 3323 | if not a.get_animated()] |
| 3324 | artists = sorted(artists, key=attrgetter('zorder')) |
| 3325 | |
| 3326 | # rasterize artists with negative zorder |
| 3327 | # if the minimum zorder is negative, start rasterization |
| 3328 | rasterization_zorder = self._rasterization_zorder |
| 3329 | |
| 3330 | if (rasterization_zorder is not None and |
| 3331 | artists and artists[0].zorder < rasterization_zorder): |
| 3332 | split_index = np.searchsorted( |
| 3333 | [art.zorder for art in artists], |
| 3334 | rasterization_zorder, side='right' |
| 3335 | ) |
| 3336 | artists_rasterized = artists[:split_index] |
| 3337 | artists = artists[split_index:] |
| 3338 | else: |
| 3339 | artists_rasterized = [] |
| 3340 | |
| 3341 | if self.axison and self._frameon: |
| 3342 | if artists_rasterized: |
| 3343 | artists_rasterized = [self.patch] + artists_rasterized |
no test coverage detected