Skip to content

Commit

Permalink
Merge pull request #236 from NicolasCami/fix-plot-2d-curve
Browse files Browse the repository at this point in the history
Fix plot 2d curve
  • Loading branch information
frank1010111 authored Dec 7, 2024
2 parents 0277e0b + 16a1d3f commit 3e9ea97
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion welly/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,14 @@ def plot_2d_curve(curve,
x2=np.nanmin(curve_data),
facecolor='none',
**kwargs)

# Combine the paths into a single Path object
vertices = np.concatenate([p.vertices for p in paths._paths])
codes = np.concatenate([p.codes for p in paths._paths])
merged_paths = mpl.path.Path(vertices, codes)

# Make the 'fill' mask and clip the background image with it.
patch = PathPatch(paths._paths[0], visible=False)
patch = PathPatch(merged_paths, visible=False)
ax.add_artist(patch)
im.set_clip_path(patch)
else:
Expand Down

0 comments on commit 3e9ea97

Please sign in to comment.