Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clipping image with path #575

Open
larsgrobe opened this issue Mar 15, 2023 · 0 comments
Open

Clipping image with path #575

larsgrobe opened this issue Mar 15, 2023 · 0 comments

Comments

@larsgrobe
Copy link

Dear all,
I am trying to export an imshow image with a set clip_path. Unfortunately, the latter is ignored. Is there any way to get this functionalitiy working, or am I just doing something wrong?
Best, Lars.

Example (with an m x n array of pixels and a patch to clip the image to):

fig, ax = plt.subplots(1, 1, figsize=(3.3,3.3))
bbox=patch.get_extents()
axis.add_patch(patch)
im = axis.imshow(dataArray2D, origin='lower', extent=(bbox.xmin, bbox.xmax, bbox.ymin, bbox.ymax))
im.set_clip_path(patch)
axis.set_axis_off()
tikzplotlib.save("clippedIm.tex")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant