Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0c7663d

Browse files
committed
Get all vertices
1 parent 6f49268 commit 0c7663d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2125,8 +2125,17 @@ def _update_patch_limits(self, patch):
21252125
((not patch.get_width()) and (not patch.get_height()))):
21262126
return
21272127
p = patch.get_path()
2128-
# Get vertices of the bounding box
2129-
vertices = p.get_extents().get_points()
2128+
# Get all vertices on the path
2129+
# Loop through each sement to get extrema (as opposed to control points)
2130+
# for Bezier curve sections
2131+
vertices = []
2132+
for curve, code in p.iter_bezier():
2133+
_, dzeros = curve.axis_aligned_extrema()
2134+
# as can the ends of the curve
2135+
vertices.append(curve([0, *dzeros, 1]))
2136+
2137+
vertices = np.row_stack(vertices)
2138+
21302139
xys = patch.get_patch_transform().transform(vertices)
21312140
if patch.get_data_transform() != self.transData:
21322141
patch_to_data = (patch.get_data_transform() -

0 commit comments

Comments
 (0)