Skip to content

Contour plot in the XZ or YZ plane #3821

Answered by ffreyer
jagoosw asked this question in Q&A
Discussion options

You must be logged in to vote

You can translate!() and rotate!() a plot to move it around in 3D space, or use transform!(plot, (plane, offset)) like volumeslices:

for (ax, p, r, (X, Y)) zip(axes, (:yz, :xz, :xy), (x, y, z), ((y, z), (x, z), (x, y)))
plot[Symbol(:heatmap_, p)] = hmap = heatmap!(
plot, attr, X, Y, zeros(length(X[]), length(Y[]))
)
plot[Symbol(:update_, p)] = update = i -> begin
transform!(hmap, (p, r[][i]))
indices = ntuple(Val(3)) do j
axes[j] == ax ? i : (:)
end
hmap[3][] = view(volume[], indices...)
end
update(1) # trigger once to place heatmaps correctly
end

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@jagoosw
Comment options

@jagoosw
Comment options

Answer selected by jagoosw
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