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

Skip to content

Commit f1a6885

Browse files
J. Scott Bergjeromefv
J. Scott Berg
authored andcommitted
Don't include CLOSEPOLY verticies when computing patch bounds
1 parent 51ab42c commit f1a6885

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import matplotlib.font_manager as font_manager
2626
import matplotlib.text as mtext
2727
import matplotlib.image as mimage
28+
import matplotlib.path as mpath
2829
from matplotlib.rcsetup import cycler, validate_axisbelow
2930

3031
_log = logging.getLogger(__name__)
@@ -2094,7 +2095,9 @@ def _update_patch_limits(self, patch):
20942095
if (isinstance(patch, mpatches.Rectangle) and
20952096
((not patch.get_width()) and (not patch.get_height()))):
20962097
return
2097-
vertices = patch.get_path().vertices
2098+
vertices = np.array([v for s in patch.get_path().iter_segments()
2099+
if s[1] != mpath.Path.CLOSEPOLY
2100+
for v in s[0]]).reshape([-1,2])
20982101
if vertices.size > 0:
20992102
xys = patch.get_patch_transform().transform(vertices)
21002103
if patch.get_data_transform() != self.transData:

0 commit comments

Comments
 (0)