From d6ed25ca37f40f5e266a43e155cb7219dbfe2b7a Mon Sep 17 00:00:00 2001 From: Lazaro Alonso Date: Fri, 5 Jan 2024 23:27:35 +0100 Subject: [PATCH] geo datavis --- docs/gen_mds.jl | 7 +--- docs/make.jl | 1 + docs/src/.vitepress/config.mts | 38 +++++++++++++++++-- examples/datavis/astronauts.jl | 16 ++++++-- examples/datavis/earthquakes.jl | 34 ++++++++++------- examples/datavis/earthquakes_proj.jl | 20 +++++----- examples/datavis/eigenvals_densities.jl | 4 +- ...es_evolution.jl => eigenvals_evolution.jl} | 4 +- examples/datavis/leos.jl | 8 +++- examples/datavis/multipleTitles.jl | 6 ++- examples/datavis/strange_attractors.jl | 6 ++- examples/datavis/timeseries_proj.jl | 15 -------- examples/geo/blue_marble.jl | 6 ++- examples/geo/coastlines.jl | 6 ++- examples/geo/donut_earth_sun.jl | 6 ++- examples/geo/gott_azimuthal.jl | 8 +++- examples/geo/moon.jl | 6 ++- examples/geo/projections.jl | 6 ++- examples/geo/rasters.jl | 27 +++++++------ examples/geo/us_states.jl | 6 ++- examples/geo/vertical_feature_mask.jl | 17 +++++---- 21 files changed, 163 insertions(+), 84 deletions(-) rename examples/datavis/{eigenvalues_evolution.jl => eigenvals_evolution.jl} (98%) delete mode 100644 examples/datavis/timeseries_proj.jl diff --git a/docs/gen_mds.jl b/docs/gen_mds.jl index 525df301..759dce1e 100644 --- a/docs/gen_mds.jl +++ b/docs/gen_mds.jl @@ -6,7 +6,7 @@ OUTPUT = joinpath(@__DIR__, "src", "examples") folders = readdir(joinpath(@__DIR__, "..", "examples")) setdiff!(folders, [".DS_Store"]) -setdiff!(folders, ["geo", "rpr", "datavis"]) +setdiff!(folders, ["rpr"]) function get_files(folders) srcsfiles = [] @@ -17,11 +17,8 @@ function get_files(folders) setdiff!(names, [".DS_Store", "world_energy.jl", "gapminder.jl", - "vertical_feature_mask.jl", + "gott_azimuthal.jl", "submarine_cables.jl", - "timeseries_proj.jl", - "earthquakes_proj.jl", - "rasters.jl", ]) fpaths = "$(f)/" .* names diff --git a/docs/make.jl b/docs/make.jl index 234201bc..ef823f04 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -4,6 +4,7 @@ include("theme_light_dark.jl") set_theme!(merge(theme_latexfonts(), theme_light_dark())) # ENV["RASTERDATASOURCES_PATH"] = "/Users/lalonso/data/" + makedocs(; sitename="BeautifulMakie", authors="Lazaro Alonso", clean=true, checkdocs=:all, diff --git a/docs/src/.vitepress/config.mts b/docs/src/.vitepress/config.mts index 1e8769be..7c93b861 100644 --- a/docs/src/.vitepress/config.mts +++ b/docs/src/.vitepress/config.mts @@ -63,8 +63,8 @@ export default defineConfig({ { text: 'Themes', link: '/examples/themes/black_epicycloid' }, { text: 'Animations', link: '/examples/animations/scatter_size' }, { text: 'Dashboards', link: '/examples/dashboards/tesseral_spherical_harmonics' }, - { text: 'Data Visualization', link: '' }, - { text: 'Geo', link: '' }, + { text: 'Data Visualization', link: '/examples/datavis/earthquakes' }, + { text: 'Geo', link: '/examples/geo/projections' }, { text: 'Algebra of Graphics', link: '/examples/aog/penguins3d' }, { text: 'Raytracing', link: '' } ]}, @@ -416,7 +416,39 @@ export default defineConfig({ ], }, ], - + '/examples/geo/': [ + { + text: 'Geo', + collapsed: true, + items: [ + { text: 'blue_marble', link: '/examples/geo/blue_marble' }, + { text: 'coastlines', link: '/examples/geo/coastlines' }, + { text: 'donut_earth_sun', link: '/examples/geo/donut_earth_sun' }, + { text: 'moon', link: '/examples/geo/moon' }, + { text: 'projections', link: '/examples/geo/projections' }, + { text: 'Rasters animation', link: '/examples/geo/rasters' }, + { text: 'us_states', link: '/examples/geo/us_states' }, + { text: 'vertical_feature_mask', link: '/examples/geo/vertical_feature_mask' }, + ], + }, + ], + '/examples/datavis/': [ + { + text: 'Data Visualization', + collapsed: true, + items: [ + { text: 'astronauts', link: '/examples/datavis/astronauts' }, + { text: 'earthquakes_proj', link: '/examples/datavis/earthquakes_proj' }, + { text: 'earthquakes', link: '/examples/datavis/earthquakes' }, + { text: 'eigenvals_densities', link: '/examples/datavis/eigenvals_densities' }, + { text: 'eigenvals_evolution', link: '/examples/datavis/eigenvals_evolution' }, + { text: 'fractals', link: '/examples/datavis/fractals' }, + { text: 'leos', link: '/examples/datavis/leos' }, + { text: 'multipleTitles', link: '/examples/datavis/multipleTitles' }, + { text: 'strange_attractors', link: '/examples/datavis/strange_attractors' }, + ], + }, + ], }, socialLinks: [ { icon: 'linkedin', link: 'https://www.linkedin.com/in/lazaro-alonso/' }, diff --git a/examples/datavis/astronauts.jl b/examples/datavis/astronauts.jl index de7485cb..09e133da 100644 --- a/examples/datavis/astronauts.jl +++ b/examples/datavis/astronauts.jl @@ -1,7 +1,9 @@ using CairoMakie, HTTP, CSV, DataFrames, DataFramesMeta, Suppressor using Images, ColorSchemes, Colors, Statistics +using Downloads using Lazy: @> CairoMakie.activate!(type = "png") + function plotastro() data_url = "https://bit.ly/3kmlGn2" @suppress begin @@ -30,12 +32,14 @@ function plotastro() astro @subset([true; :ascend_shuttle[2:end] .!= :ascend_shuttle[1:end-1]]) end - tierra = "https://climate.nasa.gov/system/internal_resources/details/original/309_ImageWall5_768px-60.jpg" + tierra = "https://eoimages.gsfc.nasa.gov/images/imagerecords/8000/8108/ipcc_bluemarble_west_front.jpg" @suppress begin global imgEarth - tierra = HTTP.download(tierra) + tierra = Downloads.download(tierra) imgEarth = load(tierra) + imgEarth = imgEarth[:,120:end-120] end + function getPoints(xi, yi, xf, yf) xyos = [] for i in 1:length(xo) @@ -69,7 +73,7 @@ function plotastro() autolimitaspect = 1) hidespines!(ax) hidedecorations!(ax) - image!(-20 .. 20, -17 .. 17, rotr90(imgEarth)) + image!(-20 .. 20, -20 .. 20, rotr90(imgEarth)) text!(astro.name, position = @.(Point2f(cos(astro.θ), sin(astro.θ)) * 85), rotation = astro.texttheta, fontsize = 6, align = astro.align) text!(string.(valYear.year_of_mission), @@ -113,4 +117,8 @@ function plotastro() fig end end -plotastro() \ No newline at end of file +fig = plotastro() + +save("astronauts.png", fig); # hide + +# ![](astronauts.png) \ No newline at end of file diff --git a/examples/datavis/earthquakes.jl b/examples/datavis/earthquakes.jl index 8974eaef..cbef5bca 100644 --- a/examples/datavis/earthquakes.jl +++ b/examples/datavis/earthquakes.jl @@ -40,7 +40,7 @@ toPoints3D = [Point3f([toCartesian(lons[i], lats[i]; ms = (exp.(mag) .- minimum(exp.(mag))) ./ maximum(exp.(mag) .- minimum(exp.(mag))) with_theme(theme_black()) do - fig = Figure(size = (1600, 1600), fontsize = 32) + fig = Figure(size = (900, 900), fontsize = 20) ax = LScene(fig[1, 1], show_axis = false) pltobj = meshscatter!(ax, toPoints3D; markersize = ms / 20 .+ 0.001, color = mag, colormap = resample_cmap(:afmhot, 256)[10:end], shading = FastShading, @@ -48,16 +48,24 @@ with_theme(theme_black()) do surface!(ax, sphere(; r = 1.0)..., color = tuple.(earth_img, 0.1), shading = FastShading, transparency = true) Colorbar(fig[1, 2], pltobj, label = "Magnitude", height = Relative(1.5 / 4)) - Label(fig[1, 1, Bottom()], "Visualization by @LazarusAlon\nusing Makie") - Label(fig[1, 1, Top()], "Earthquakes on Earth between January 2021 and January 2022.\nOriginal data from USGS") - zoom!(ax.scene, cameracontrols(ax.scene), 0.65) + Label(fig[1, 1, Top()], + rich("Visualization by ", + rich("Lazaro Alonso\n", color=:dodgerblue), + rich("using Makie", color=:orangered)), + justification=:left, + halign=1.0 + ) + Label(fig[1, 1, Top()], "Earthquakes on Earth. Jan-2021 to Jan-2022\nOriginal data from USGS", + halign=0.0, justification=:left) + zoom!(ax.scene, cameracontrols(ax.scene), 0.55) rotate!(ax.scene, 3.0) - ## uncomment to get the animation - ## record(fig, joinpath(@__DIR__, "earthquakes.mp4"), framerate = 24) do io - ## for i in 3.0:0.015:9.5 - ## rotate!(ax.scene, i) - ## recordframe!(io) # record a new frame - ## end - ## end - fig -end \ No newline at end of file + + record(fig, "earthquakes.mp4", framerate = 24, update=false) do io + for i in 3.0:0.015:9.5 + rotate!(ax.scene, i) + recordframe!(io) # record a new frame + end + end +end + +# ![type:video](earthquakes.mp4) \ No newline at end of file diff --git a/examples/datavis/earthquakes_proj.jl b/examples/datavis/earthquakes_proj.jl index baeb9844..499d49ca 100644 --- a/examples/datavis/earthquakes_proj.jl +++ b/examples/datavis/earthquakes_proj.jl @@ -28,24 +28,26 @@ plt = data(n15) * mapping(:n, :depth, color=:mag, text = :place => verbatim) * ptxt = data(n15) * mapping(:x, :n=>(t->t+0.25), text = :place => verbatim) * visual(Makie.Text, align = (:left, :bottom)) -with_theme(theme_black(), size = (1400,800)) do +with_theme(theme_dark(), size = (1400,800)) do fig = Figure() - gax = GeoAxis(fig[1,2]; aspect = 1, - dest = "+proj=eqdc +lat_1=90 +lat_2=90", - coastlines = true, coastline_attributes = (; color=:papayawhip, linewidth=0.5) - ) + gax = GeoAxis(fig[1,2]; aspect = 1, dest = "+proj=eqdc +lat_1=90 +lat_2=90") axlocs = Axis(fig[1,1], xlabel = "depth [km]", ylabel = "magnitude") - obj = draw!(gax, p) - colorbar!(fig[1,3], obj) + lines!(gax, GeoMakie.coastlines(), color=:papayawhip, linewidth=0.5) + #obj = draw!(gax, p) + obj = scatter!(gax, df[!, :longitude], df[!, :latitude]; + color = df[!, :mag], colormap = Reverse(:Hiroshige), + markersize = 50*(exp.(df[!, :mag]) .- mn)/mx ) + + Colorbar(fig[1,3], obj) draw!(axlocs, plt) draw!(axlocs, ptxt) axlocs.yticks = (1:15, string.(n15[!, :mag])) colsize!(fig.layout, 1, Auto(0.5)) colgap!(fig.layout,0) hidespines!(axlocs, :r, :t) - Label(fig[1, 2, Bottom()], "Visualization by @LazarusAlon\nusing Makie") + Label(fig[1, 2, Bottom()], "\n\nVisualization by @LazarusAlon\nusing Makie") Label(fig[1, 1, Top()], - "Earthquakes on Earth between January 2021 and January 2022.\nOriginal data from USGS", + "Earthquakes on Earth. Jan-2021 to Jan-2022.\nOriginal data from USGS", color = :gold) fig end diff --git a/examples/datavis/eigenvals_densities.jl b/examples/datavis/eigenvals_densities.jl index 4d20cddd..e930ea70 100644 --- a/examples/datavis/eigenvals_densities.jl +++ b/examples/datavis/eigenvals_densities.jl @@ -80,11 +80,11 @@ m3(;a=9rand()-5,b=9rand()-5) = [a 1 -1; -1 b 0; 1 -1 -1] h = HeatMap(range(-4,4,length=1200),range(-2,2,length=1200)) getcounts!(h, m3; n = 1_500_000) -with_theme(theme_ggplot2()) do +with_theme(theme_dark()) do fig = Figure(figure_padding=0,size=(600,400)) ax = Axis(fig[1,1]; aspect = DataAspect()) heatmap!(ax, -4..4, -2..2,eq_hist(h.counts); - colormap = :seaborn_icefire_gradient) + colormap = :CMRmap) hidedecorations!(ax) hidespines!(ax) fig diff --git a/examples/datavis/eigenvalues_evolution.jl b/examples/datavis/eigenvals_evolution.jl similarity index 98% rename from examples/datavis/eigenvalues_evolution.jl rename to examples/datavis/eigenvals_evolution.jl index d64e17e7..227cab61 100644 --- a/examples/datavis/eigenvalues_evolution.jl +++ b/examples/datavis/eigenvals_evolution.jl @@ -56,8 +56,8 @@ function m12(n=10) return a, b end -n = 100 -a, b = m12(100) +n = 150 +a, b = m12(n) xs, ys = xy(a,b) colors = repeat(1:n,inner=500) diff --git a/examples/datavis/leos.jl b/examples/datavis/leos.jl index ffee416e..d7602240 100644 --- a/examples/datavis/leos.jl +++ b/examples/datavis/leos.jl @@ -29,7 +29,7 @@ function BezierPath(o, f, co, cf; t = range(0,1, length=30)) return [poly3(t, o, co, cf, f) for t in t] end function posFig(ax, x; yoff=100, ylow = 15) - o = ax.scene.px_area[].origin - Point2f(0, yoff) + o = ax.scene.viewport[].origin - Point2f(0, yoff) return Makie.project(ax.scene, Point2f(x, ylow)) + o end function supLine(p1, p2; x=0,y=8) @@ -95,4 +95,8 @@ with_theme(theme_black()) do margin = (30, 10, 10, 10), framecolor = (:white,0.2)) Label(fig[0,:], "Leo's Syndrome", color = "#F79D1EFF", fontsize = 32) fig -end \ No newline at end of file +end + +save("leos.png", current_figure()); # hide + +# ![](leos.png) \ No newline at end of file diff --git a/examples/datavis/multipleTitles.jl b/examples/datavis/multipleTitles.jl index d56f4dbd..ddfc4a4d 100644 --- a/examples/datavis/multipleTitles.jl +++ b/examples/datavis/multipleTitles.jl @@ -52,4 +52,8 @@ with_theme(theme_dark(), size = (650, 450)) do inter-bank rate. The dots depict the forward paths for nominal interest rates. """, tellwidth = false, halign = :left, justification = :left) fig -end \ No newline at end of file +end + +save("multipleTitles.svg", current_figure()); # hide + +# ![](multipleTitles.svg) diff --git a/examples/datavis/strange_attractors.jl b/examples/datavis/strange_attractors.jl index 5b6c47bb..854909ad 100644 --- a/examples/datavis/strange_attractors.jl +++ b/examples/datavis/strange_attractors.jl @@ -78,4 +78,8 @@ with_theme(theme_black()) do rowgap!(fig.layout,5) colgap!(fig.layout,1) fig -end \ No newline at end of file +end + +save("strange_attractors.png", current_figure()); # hide + +# ![](strange_attractors.png) \ No newline at end of file diff --git a/examples/datavis/timeseries_proj.jl b/examples/datavis/timeseries_proj.jl deleted file mode 100644 index 0e6bf450..00000000 --- a/examples/datavis/timeseries_proj.jl +++ /dev/null @@ -1,15 +0,0 @@ -using MarketData, DataFrames -using AlgebraOfGraphics, GLMakie, GeoMakie -using Statistics -plt = data(cl)*mapping(:timestamp, :Close)*visual(Lines) - -with_theme(theme_ggplot2(), size = (600,400)) do - plt |> draw -end - -function tolats(x) - -end -df = DataFrame(cl) -df[!, :tolon] .= collect(range(-180,180, length=length(cl))) -#df[!, :newvals] .= \ No newline at end of file diff --git a/examples/geo/blue_marble.jl b/examples/geo/blue_marble.jl index 73f9013c..3ddb8a09 100644 --- a/examples/geo/blue_marble.jl +++ b/examples/geo/blue_marble.jl @@ -21,4 +21,8 @@ surface!(ax, x, y, z; ) zoom!(ax.scene, cameracontrols(ax.scene), 0.65) GLMakie.rotate!(ax.scene, Vec3f(0, 0, 1), 3.0) -fig \ No newline at end of file +fig + +save("blue_marble.png", fig); # hide + +# ![](blue_marble.png) \ No newline at end of file diff --git a/examples/geo/coastlines.jl b/examples/geo/coastlines.jl index 59dceef6..f071eda2 100644 --- a/examples/geo/coastlines.jl +++ b/examples/geo/coastlines.jl @@ -4,4 +4,8 @@ GLMakie.activate!() fig = Figure(; size=(600, 400)) ax = GeoAxis(fig[1, 1]; title="coastlines") lines!(ax, GeoMakie.coastlines()) # plot coastlines from Natural Earth. -fig \ No newline at end of file +fig + +save("coastlines.png", fig); # hide + +# ![](coastlines.png) \ No newline at end of file diff --git a/examples/geo/donut_earth_sun.jl b/examples/geo/donut_earth_sun.jl index 01956d34..104f7046 100644 --- a/examples/geo/donut_earth_sun.jl +++ b/examples/geo/donut_earth_sun.jl @@ -38,4 +38,8 @@ with_theme(theme_dark()) do backlight = 1.5f0) hidedecorations!(ax; grid=false) fig -end \ No newline at end of file +end + +save("donut_earth_sun.png", current_figure()); # hide + +# ![](donut_earth_sun.png) \ No newline at end of file diff --git a/examples/geo/gott_azimuthal.jl b/examples/geo/gott_azimuthal.jl index a11d609d..af35fdb8 100644 --- a/examples/geo/gott_azimuthal.jl +++ b/examples/geo/gott_azimuthal.jl @@ -1,6 +1,6 @@ using GeoMakie using GLMakie - +GLMakie.activate!() # Double-sided disk map: Gott, Goldberg and Vanderbei’s" fig = Figure(; size=(1200, 600)) ax_top = GeoAxis(fig[1, 1]; dest="+proj=aeqd +lat_0=90 +lon_0=-45", @@ -14,4 +14,8 @@ lines!(ax_top, GeoMakie.coastlines()) lines!(ax_bottom, GeoMakie.coastlines()) #ylims!(ax_bottom, -90, 0) #ylims!(ax_top, 0, 90) -fig \ No newline at end of file +fig + +save("gott_azimuthal.png", fig); # hide + +# ![](gott_azimuthal.png) \ No newline at end of file diff --git a/examples/geo/moon.jl b/examples/geo/moon.jl index 3f856375..db223490 100644 --- a/examples/geo/moon.jl +++ b/examples/geo/moon.jl @@ -23,4 +23,8 @@ surface!(ax, x, y, z; hidedecorations!(ax) hidespines!(ax) fig[1, 1] = ax -fig \ No newline at end of file +fig + +save("moon.png", fig); # hide + +# ![](moon.png) \ No newline at end of file diff --git a/examples/geo/projections.jl b/examples/geo/projections.jl index 7f8403dd..8c102b4a 100644 --- a/examples/geo/projections.jl +++ b/examples/geo/projections.jl @@ -48,4 +48,8 @@ function plotproj() end fig end -plotproj() \ No newline at end of file + +fig = plotproj() +save("projections.png", fig); # hide + +# ![](projections.png) \ No newline at end of file diff --git a/examples/geo/rasters.jl b/examples/geo/rasters.jl index 4512815f..4e0df9c3 100644 --- a/examples/geo/rasters.jl +++ b/examples/geo/rasters.jl @@ -17,7 +17,6 @@ # ENV["RASTERDATASOURCES_PATH"] = ".." # joinpath(tempdir(), "Rasters"), needed for RasterDataSources # Let's load the packages: - using Rasters using RasterDataSources using ArchGDAL @@ -49,7 +48,7 @@ worldclim_stacks[1].tmax # `z` are the values of the raster at the points `(x, y)`. This is the format # that we can supply directly to Makie. -Makie.convert_arguments(Makie.VertexBasedGrid(), worldclim_stacks[1].tmax); +Makie.convert_arguments(Makie.VertexGrid(), worldclim_stacks[1].tmax); # Let's extract two variables from this stack, the maximum temperature (`:tmax`), # and the precipitation (`:prec`). @@ -77,16 +76,20 @@ prec_interpolated = DataInterpolations.QuadraticInterpolation(prec_rasters, 1:le # ## A simple animation # Let's see if this interpolation worked. We create a figure to animate: +ras_inter = temp_interpolated(1.0) +ras_inter = replace_missing(ras_inter, NaN) + temp_inter = Observable(temp_interpolated(1.0)) -fig= Figure(size = (800,800)) -ax = Axis3(fig[1,1];perspectiveness=0.5, +fig= Figure(; size = (800,800)) +ax = Axis3(fig[1,1]; perspectiveness=0.5, azimuth=-0.5, elevation=0.57, aspect=(1, 1, 1)) -plt = surface!(ax, temp_inter; transparency=true) -hm = heatmap!(ax, temp_inter; nan_color=:black) +plt = surface!(ax, ras_inter; transparency=true) +hm = heatmap!(ax, ras_inter; nan_color=:black) translate!(hm, 0, 0, -30) # get the heatmap to the bottom of the plot fig # hide + # Now that the figure has been created, we can animate and record it. # This is done using Makie's `record` convenience function, which can iterate through a range, @@ -97,7 +100,7 @@ fig # hide @time record(fig, "temperature_surface_animation.mp4", LinRange(1, 12, 480÷4); framerate = 30) do i ax.title[] = @sprintf "%.2f" i - temp_inter[] = temp_interpolated(i) + temp_inter[] = replace_missing(temp_interpolated(i), NaN) end; # ![type:video](temperature_surface_animation.mp4) @@ -145,7 +148,7 @@ Makie.to_colormap(cmap) # hide # We create the Figure, which is the top-level object in Makie, # and holds the axis which holds our plots. -fig = Figure(size=(800 * 2, 800 * 2)) +fig = Figure(; size=(800, 800)) # First, we plot an empty the sphere ax, plt_obj = mesh(fig[1, 1], uv_normal_mesh(Tesselation(Sphere(Point3f(0), 0.99), 128)); color=(:white, 0.1), transparency=true, @@ -154,7 +157,7 @@ ax, plt_obj = mesh(fig[1, 1], uv_normal_mesh(Tesselation(Sphere(Point3f(0), 0.99 # Then, we plot the sphere, which displays temperature. temperature_plot = mesh!( m; - color=Makie.convert_arguments(Makie.VertexBasedGrid(), worldclim_stacks[10].tmax)[3]'[end:-1:1,:] |> Matrix, + color=Makie.convert_arguments(Makie.VertexGrid(), worldclim_stacks[10].tmax)[3]'[end:-1:1,:] |> Matrix, colorrange=(-65, 50), lowclip=:transparent, colormap=:tableau_temperature, #cmap, @@ -189,7 +192,7 @@ end # We don't want to call `convert_arguments` all the time, so let's # define a convenience function to do it: -raster2array(raster) = Makie.convert_arguments(Makie.VertexBasedGrid(), raster)[3]'[end:-1:1,:] +raster2array(raster) = Makie.convert_arguments(Makie.VertexGrid(), raster)[3]'[end:-1:1,:] watervals = watermap(uv, raster2array(worldclim_stacks[1].prec)) # Let's finally plot the meshscatter! @@ -221,11 +224,11 @@ Colorbar(fig[1,2], temperature_plot, label="Temperature", height = Relative(0.5) Colorbar(fig[2,1], prec_plot, label="Precipitation", width = Relative(0.5), vertical=false) zoom!(ax.scene, cameracontrols(ax.scene), 0.65) -fig # hide +display(fig; update=false) # hide # Now, we animate the water and temperature plots! -record(fig, "worldclim_visualization.mp4", LinRange(1, 24, 600÷4); framerate = 24) do i +record(fig, "worldclim_visualization.mp4", LinRange(1, 24, 600÷4); framerate = 24, update=false) do i title_label.text[] = @sprintf "%.2f" (i % 12) temperature_plot.color[] = raster2array(temp_interpolated(i % 12)) watervals = max.(0, watermap(uv, raster2array(prec_interpolated(i % 12)))) diff --git a/examples/geo/us_states.jl b/examples/geo/us_states.jl index 5b140b97..3b098737 100644 --- a/examples/geo/us_states.jl +++ b/examples/geo/us_states.jl @@ -14,4 +14,8 @@ fig = Figure(size=(1200, 800), fontsize=22) ax = GeoAxis(fig[1, 1]; dest="+proj=wintri", title="Projection: Winkel Tripel, US States") poly!(ax, states_geo, color=1:n, colormap=:plasma, strokecolor=:black, strokewidth=1) ylims!(ax,-90,90) -fig \ No newline at end of file +fig + +save("us_states.png", fig); # hide + +# ![](us_states.png) \ No newline at end of file diff --git a/examples/geo/vertical_feature_mask.jl b/examples/geo/vertical_feature_mask.jl index 72b452dc..99224464 100644 --- a/examples/geo/vertical_feature_mask.jl +++ b/examples/geo/vertical_feature_mask.jl @@ -28,12 +28,15 @@ end fig = Figure(size=(800, 400), fontsize=22) ax = LScene(fig[1,1]; show_axis=false) -lines!(ax, GeoMakie.coastlines(), transparency=true) -lines!(ax, linepath, color = :red, linewidth=2.5, transparency=true) -lines!(ax, linepathh, color = :red, linewidth=2.5, transparency=true) -band!(ax, linepath, linepathh, color = repeat(1:1384,outer=2)) +lines!(ax, GeoMakie.coastlines(), transparency=true, color=:white) +lines!(ax, linepath, color = :orangered, linewidth=2.5, transparency=true) +lines!(ax, linepathh, color = :white, linewidth=2.5, transparency=true) +band!(ax, linepath, linepathh, color = repeat(1:1384,outer=2), transparency=true) image!(ax, -180..180, -90..90, earth_img'[:,end:-1:1]) -rotate!(ax.scene, 2*pi/3) +rotate!(ax.scene, 2*pi/2.6) fig -zoom!(ax.scene, cameracontrols(ax.scene), 0.45) -display(fig; update=false) +zoom!(ax.scene, cameracontrols(ax.scene), 30) +#center!(ax.scene) +save("vertical_feature_mask.png", fig, update=false); # hide + +# ![](vertical_feature_mask.png) \ No newline at end of file