library(geodata)
Loading required package: terra
terra 1.7.78
library(terra)
library(geodata)
Loading required package: terra
terra 1.7.78
library(terra)
<- geodata::elevation_global(res = 10, path = tempdir()) elev
plot(elev)
Play around with the arguments in fields::image.plot() function.
plot(elev, legend = FALSE)
# Add a custom legend on the left side with increased font size
::image.plot(elev[], legend.only = TRUE, horizontal = FALSE,
fieldszlim = range(values(elev), finite = TRUE),
legend.width = 1.3, legend.shrink = 0.85,
axis.args = list(cex.axis = 1.7),
legend.mar = 40, # Adjust margin to make space on the left
legend.lab = "Elevation (m)", # Optional: Add a legend label
legend.args = list(side = 2, line = 2))