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 a4b85b8

Browse filesBrowse files
dstansbyMeeseeksDev[bot]
authored andcommitted
Backport PR #12709: Correctly remove nans when drawing paths with pycairo.
1 parent 6080c21 commit a4b85b8
Copy full SHA for a4b85b8

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+3
-2
lines changed

‎lib/matplotlib/backends/backend_cairo.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_cairo.py
+3-2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.