Draw using blit() or draw_idle(), depending on ``self.useblit``.
(self)
| 2433 | event.button != self._eventpress.button) |
| 2434 | |
| 2435 | def update(self): |
| 2436 | """Draw using blit() or draw_idle(), depending on ``self.useblit``.""" |
| 2437 | if (not self.ax.get_visible() or |
| 2438 | self.ax.get_figure(root=True)._get_renderer() is None): |
| 2439 | return |
| 2440 | if self.useblit: |
| 2441 | background = self._load_blit_background() |
| 2442 | if background is not None: |
| 2443 | self.canvas.restore_region(background) |
| 2444 | else: |
| 2445 | self.update_background(None) |
| 2446 | # We need to draw all artists, which are not included in the |
| 2447 | # background, therefore we also draw self._get_animated_artists() |
| 2448 | # and we make sure that we respect z_order |
| 2449 | artists = sorted(self.artists + self._get_animated_artists(), |
| 2450 | key=lambda a: a.get_zorder()) |
| 2451 | for artist in artists: |
| 2452 | self.ax.draw_artist(artist) |
| 2453 | self.canvas.blit(self.ax.bbox) |
| 2454 | else: |
| 2455 | self.canvas.draw_idle() |
| 2456 | |
| 2457 | def _get_data(self, event): |
| 2458 | """Get the xdata and ydata for event, with limits.""" |
no test coverage detected