Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 85ef30b

Browse filesBrowse files
committed
canvas.blit() already defaults to blitting the full figure canvas.
... so `canvas.blit(figure.bbox)` can be replaced by `canvas.blit()`. The argumentless form is actually more accurate because the computation of `figure.bbox` can suffer from floating point inaccuracies, which, even if correctly taken into account, could lead to blitting one row/column too few or too many, whereas `canvas.blit()` with no arguments will, well, always blit the full canvas.
1 parent 146de7f commit 85ef30b
Copy full SHA for 85ef30b

File tree

Expand file treeCollapse file tree

2 files changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-3
lines changed

‎lib/matplotlib/offsetbox.py

Copy file name to clipboardExpand all lines: lib/matplotlib/offsetbox.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,7 +1650,7 @@ def on_motion_blit(self, evt):
16501650
self.update_offset(dx, dy)
16511651
self.canvas.restore_region(self.background)
16521652
self.ref_artist.draw(self.ref_artist.figure._cachedRenderer)
1653-
self.canvas.blit(self.ref_artist.figure.bbox)
1653+
self.canvas.blit()
16541654

16551655
def on_pick(self, evt):
16561656
if self._check_still_parented() and evt.artist == self.ref_artist:
@@ -1665,7 +1665,7 @@ def on_pick(self, evt):
16651665
self.background = self.canvas.copy_from_bbox(
16661666
self.ref_artist.figure.bbox)
16671667
self.ref_artist.draw(self.ref_artist.figure._cachedRenderer)
1668-
self.canvas.blit(self.ref_artist.figure.bbox)
1668+
self.canvas.blit()
16691669
self._c1 = self.canvas.mpl_connect('motion_notify_event',
16701670
self.on_motion_blit)
16711671
else:

‎lib/matplotlib/widgets.py

Copy file name to clipboardExpand all lines: lib/matplotlib/widgets.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1464,7 +1464,7 @@ def _update(self):
14641464
if self.horizOn:
14651465
for ax, line in zip(self.axes, self.hlines):
14661466
ax.draw_artist(line)
1467-
self.canvas.blit(self.canvas.figure.bbox)
1467+
self.canvas.blit()
14681468
else:
14691469
self.canvas.draw_idle()
14701470

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.