Skip to content
Discussion options

You must be logged in to vote

You can set the alpha (opacity) on a voxel-by-voxel basis. Normally, you would probably create another array, with the same shape as contour with alpha values between 0 and 1. However, in your case, contour already contains the correct alphas! (Because you want alpha=1 where contour=1 and 0 elsewhere.)

fig, ax = plt.subplots()
ax.imshow(im, cmap="gray")
ax.imshow(contour, alpha=contour)

ax.set_axis_off()
plt.show()

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@rijobro
Comment options

rijobro Mar 18, 2021
Collaborator

@ghost
Comment options

@Meddebma
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants