Skip to content

Commit

Permalink
do record
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarusA committed Jan 5, 2024
1 parent 25bf800 commit de82a3c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
MapTiles = "fea52e5a-b371-463b-85f5-81770daa2737"
OSMMakie = "76b6901f-8821-46bb-9129-841bc9cfe677"
TileProviders = "263fe934-28e1-4ae9-998a-c2629c5fede6"
Tyler = "e170d443-b9d6-418a-9ee8-061e966341ef"
37 changes: 16 additions & 21 deletions docs/examples/UserGuide/iceloss_ex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,26 +63,21 @@ hidespines!(m.axis);
wait(m)
#

## ------ uncomment to create interactive-animated figure -----
## The Documenter does not allow creations of interactive plots

## loop to create animation
# if interactive
# for k = 1:15
# # reset apha
# alpha[:] = zeros(nc);
# cmap[] = Colors.alphacolor.(cmap[], alpha)
#
# for i in 2:1:n
# # modify alpha
# alpha[1:maximum([1,round(Int64,i*nc/n)])] = alpha[1:maximum([1,round(Int64,i*nc/n)])] .* (1.05^-1.5);
# alpha[maximum([1,round(Int64,i*nc/n)])] = 1;
# cmap[] = Colors.alphacolor.(cmap[], alpha);
# sleep(0.001);
# end
# end
# end
## -----------------------------------------------------------
record(m.figure, "iceloss.mp4", framerate=24) do io
for k = 1:15
# reset apha
alpha[:] = zeros(nc);
cmap[] = Colors.alphacolor.(cmap[], alpha)

for i in 2:10:n
# modify alpha
alpha[1:maximum([1,round(Int64,i*nc/n)])] = alpha[1:maximum([1,round(Int64,i*nc/n)])] .* (1.05^-1.5)
alpha[maximum([1,round(Int64,i*nc/n)])] = 1
cmap[] = Colors.alphacolor.(cmap[], alpha)
recordframe!(io) # record a new frame
end
end
end

# !!! info
# Ice loss from the Greenland Ice Sheet: 1972-2022.
Expand All @@ -91,4 +86,4 @@ wait(m)

# <video src="https://github.com/JuliaGeo/JuliaGeoData/raw/main/assets/videos/iceloss.mp4" width="400" />


# ![type:video](iceloss.mp4)

0 comments on commit de82a3c

Please sign in to comment.