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

Skip to content

Commit c44558e

Browse files
authored
Merge pull request #12709 from anntzer/cairo-nans
Correctly remove nans when drawing paths with pycairo.
2 parents bee410d + af478fe commit c44558e

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
@@ -88,7 +88,8 @@ def buffer_info(self):
8888

8989
def _append_paths_slow(ctx, paths, transforms, clip=None):
9090
for path, transform in zip(paths, transforms):
91-
for points, code in path.iter_segments(transform, clip=clip):
91+
for points, code in path.iter_segments(
92+
transform, remove_nans=True, clip=clip):
9293
if code == Path.MOVETO:
9394
ctx.move_to(*points)
9495
elif code == Path.CLOSEPOLY:
@@ -116,7 +117,7 @@ def _append_paths_fast(ctx, paths, transforms, clip=None):
116117
# Convert curves to segment, so that 1. we don't have to handle
117118
# variable-sized CURVE-n codes, and 2. we don't have to implement degree
118119
# elevation for quadratic Beziers.
119-
cleaneds = [path.cleaned(transform=transform, clip=clip, curves=False)
120+
cleaneds = [path.cleaned(transform, remove_nans=True, clip=clip)
120121
for path, transform in zip(paths, transforms)]
121122
vertices = np.concatenate([cleaned.vertices for cleaned in cleaneds])
122123
codes = np.concatenate([cleaned.codes for cleaned in cleaneds])

0 commit comments

Comments
 (0)