You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm new to GeoMakie, and I'm trying to start using it as my main tool for plotting maps in Julia. I've been struggling to implement a plot with multiple subplots with different lat/lon ranges. Here's the code (not reproducible):
theme =Theme(fontsize=18, font="TeX Gyre Heros")
set_theme!(theme)
# Ice surface velocities
figV = Makie.Figure(resolution=(1200, 1800))
n =5
m =floor(Int, length(gdirs_climate[2])/n)
axsV = []
k =1for i in1:n
for j in1:m
push!(axsV, GeoAxis(figV[i, j], source ="+proj=tmerc +lon_0=$(gdirs[k].cenlon) +lat_0=$(gdirs[k].cenlat)",
dest ="+proj=tmerc +lon_0=$(gdirs[k].cenlon) +lat_0=$(gdirs[k].cenlat)",
lonlims=(gdirs[k].extent_ll[1,1], gdirs[k].extent_ll[1,2]),
latlims=(gdirs[k].extent_ll[2,1], gdirs[k].extent_ll[2,2]),
coastlines =true, remove_overlapping_ticks =true))
k +=1endendtightlimits!.(axsV)
Vs, hm_Vs = [],[]
for (i, ax) inenumerate(axsV)
ax.aspect =DataAspect()
rgi_id = gdirs[i].rgi_id
name = gdirs[i].name
ax.title ="$name - $rgi_id\n$(gdirs[i].cenlat)° - $(gdirs[i].cenlon)°"
Vx = PDE_refs["V̄x_refs"][i]
Vy = PDE_refs["V̄y_refs"][i]
V = (abs.(Vx) .+abs.(Vy))./2
lons = gdirs[i].extent_ll[1,:]
lats = gdirs[i].extent_ll[2,:]
push!(Vs,V)
lonrange =collect(range(lons[1], lons[2], length=size(V)[1]))
latrange =collect(range(lats[1], lats[2], length=size(V)[2]))
push!(hm_Vs, Makie.heatmap!(ax, lonrange, latrange, fillZeros(V), colormap=:speed))
end
minV =minimum(minimum.(Vs))
maxV =maximum(maximum.(Vs))
Colorbar(figV[2:3,m+1], limits=(minV,maxV), colormap=:speed, label="Ice surface velocity")
Label(figV[0, :], text ="Glacier dataset", textsize =30)
if display
display(figV)
end
Makie.save(joinpath(root_plots, "glaciers_V.pdf"), figV, pt_per_unit =1)
Which produces the following plot:
What am I doing wrong? How can I correctly crop the subplot extent in order to "zoom" on the given lat/lon extent? Sorry for the noob question, but I haven't been able to figure this out with the documentation. Thanks in advance!
The text was updated successfully, but these errors were encountered:
I'm new to GeoMakie, and I'm trying to start using it as my main tool for plotting maps in Julia. I've been struggling to implement a plot with multiple subplots with different lat/lon ranges. Here's the code (not reproducible):
Which produces the following plot:
What am I doing wrong? How can I correctly crop the subplot extent in order to "zoom" on the given lat/lon extent? Sorry for the noob question, but I haven't been able to figure this out with the documentation. Thanks in advance!
The text was updated successfully, but these errors were encountered: