Skip to content

Commit

Permalink
Calculate vmin and vmax globally for the cube in makeAnimation
Browse files Browse the repository at this point in the history
  • Loading branch information
firasalchalabi committed Jun 4, 2024
1 parent 4f26ae8 commit f53c097
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/makeAnimation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ function makeAnimation(
framerate::Integer=30
)

a, b = __calculate_pclip(A, pclip=pclip)

# Creating an observable that triggers a change in the figure after a change in its value
obs = Observable(A[:, :, 1])

Expand All @@ -18,9 +20,9 @@ function makeAnimation(
ax = Axis(fig[1,1], yreversed=true, xautolimitmargin=(0,0), yautolimitmargin=(0,0))

# Creating a plot based on observable obs. If obs[] changes the plot automatically changes
seisimageplot!(ax, obs, pclip=pclip, ox=ox, dx=dx, oy=0, dy=1)
seisimageplot!(ax, obs, pclip=pclip, ox=ox, dx=dx, oy=oy, dy=dy, vmin=a, vmax=b)

record(fig, filename, iterations; framerate=30) do it
record(fig, filename, iterations; framerate=framerate) do it
# modifying the Observable variable to change the plot
obs[] = A[:, :, it]
end
Expand Down

0 comments on commit f53c097

Please sign in to comment.