Skip to content

Commit 3e9ea97

Browse files
authored
Merge pull request #236 from NicolasCami/fix-plot-2d-curve
Fix plot 2d curve
2 parents 0277e0b + 16a1d3f commit 3e9ea97

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

welly/plot.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,14 @@ def plot_2d_curve(curve,
393393
x2=np.nanmin(curve_data),
394394
facecolor='none',
395395
**kwargs)
396+
397+
# Combine the paths into a single Path object
398+
vertices = np.concatenate([p.vertices for p in paths._paths])
399+
codes = np.concatenate([p.codes for p in paths._paths])
400+
merged_paths = mpl.path.Path(vertices, codes)
396401

397402
# Make the 'fill' mask and clip the background image with it.
398-
patch = PathPatch(paths._paths[0], visible=False)
403+
patch = PathPatch(merged_paths, visible=False)
399404
ax.add_artist(patch)
400405
im.set_clip_path(patch)
401406
else:

0 commit comments

Comments
 (0)