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

Skip to content

Commit 854a85a

Browse files
authored
Merge pull request #12710 from meeseeksmachine/auto-backport-of-pr-12709-on-v3.0.x
Backport PR #12709 on branch v3.0.x (Correctly remove nans when drawing paths with pycairo.)
2 parents 6080c21 + a4b85b8 commit 854a85a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/matplotlib/backends/backend_cairo.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ def buffer_info(self):
9090

9191
def _append_paths_slow(ctx, paths, transforms, clip=None):
9292
for path, transform in zip(paths, transforms):
93-
for points, code in path.iter_segments(transform, clip=clip):
93+
for points, code in path.iter_segments(
94+
transform, remove_nans=True, clip=clip):
9495
if code == Path.MOVETO:
9596
ctx.move_to(*points)
9697
elif code == Path.CLOSEPOLY:
@@ -118,7 +119,7 @@ def _append_paths_fast(ctx, paths, transforms, clip=None):
118119
# Convert curves to segment, so that 1. we don't have to handle
119120
# variable-sized CURVE-n codes, and 2. we don't have to implement degree
120121
# elevation for quadratic Beziers.
121-
cleaneds = [path.cleaned(transform=transform, clip=clip, curves=False)
122+
cleaneds = [path.cleaned(transform, remove_nans=True, clip=clip)
122123
for path, transform in zip(paths, transforms)]
123124
vertices = np.concatenate([cleaned.vertices for cleaned in cleaneds])
124125
codes = np.concatenate([cleaned.codes for cleaned in cleaneds])

0 commit comments

Comments
 (0)