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 46bd2ff

Browse filesBrowse files
committed
Decrease uses of get_canvas_width_height.
One can directly get the canvas size from the parent figure. This avoids running into possible bugs in implementations of get_canvas_width_height(!) which I plan to ultimately deprecate.
1 parent ae93d77 commit 46bd2ff
Copy full SHA for 46bd2ff

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+3
-4
lines changed

‎lib/matplotlib/collections.py

Copy file name to clipboardExpand all lines: lib/matplotlib/collections.py
+3-4Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,13 +295,12 @@ def draw(self, renderer):
295295
len(self._antialiaseds) == 1 and len(self._urls) == 1 and
296296
self.get_hatch() is None):
297297
if len(trans):
298-
combined_transform = (transforms.Affine2D(trans[0]) +
299-
transform)
298+
combined_transform = transforms.Affine2D(trans[0]) + transform
300299
else:
301300
combined_transform = transform
302301
extents = paths[0].get_extents(combined_transform)
303-
width, height = renderer.get_canvas_width_height()
304-
if extents.width < width and extents.height < height:
302+
if (extents.width < self.figure.bbox.width
303+
and extents.height < self.figure.bbox.height):
305304
do_single_path_optimization = True
306305

307306
if self._joinstyle:

0 commit comments

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