-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added makeAnimtion function and edited seisimageplot to check if the …
…two ends of colorrange are identical
- Loading branch information
1 parent
4ca8a6c
commit 91de797
Showing
3 changed files
with
39 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
function makeAnimation( | ||
filename::String, | ||
A::AbstractArray{<:Real}; | ||
pclip = 98, | ||
ox = 0, | ||
dx = 1, | ||
oy = 0, | ||
dy = 1, | ||
framerate::Integer=30 | ||
) | ||
|
||
# Creating an observable that triggers a change in the figure after a change in its value | ||
obs = Observable(A[:, :, 1]) | ||
|
||
iterations = 1:size(A,3) | ||
|
||
fig = Figure() | ||
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) | ||
|
||
record(fig, filename, iterations; framerate=30) do it | ||
# modifying the Observable variable to change the plot | ||
obs[] = A[:, :, it] | ||
end | ||
|
||
return nothing | ||
end |