Skip to content

... plot layers using Makie? ​

The layers are integrated with the Makie plotting package.

julia
using SpeciesDistributionToolkit
using CairoMakie

Let's grab two layers:

julia
spatial_extent = (; left = -4.87, right=9.63, bottom=41.31, top=51.14)
data_prov = RasterData(CHELSA1, BioClim)
temperature = 0.1SDMLayer(data_prov; layer="BIO1", spatial_extent...)
precipitation = SDMLayer(data_prov; layer="BIO8", spatial_extent...)
πŸ—ΊοΈ  A 1180 Γ— 1741 layer with 1497697 Int16 cells
   Projection: +proj=longlat +datum=WGS84 +no_defs

Additional arguments

All of these plots can be further customized by passing the usual arguments to Makie plots.

Recipes for a single layer ​

Heatmap ​

julia
heatmap(temperature; axis=(; aspect=DataAspect()))

Contour ​

julia
contour(temperature; axis=(; aspect=DataAspect()))

Filled contour ​

julia
contourf(temperature; axis=(; aspect=DataAspect()))

Histogram ​

julia
hist(temperature)

Density ​

julia
density(temperature)

Step histogram ​

julia
stephist(temperature)

ECDF plot ​

julia
ecdfplot(temperature)

Recipes for two layers ​

Scatterplot ​

julia
scatter(precipitation, temperature)

Density ​

julia
hexbin(precipitation, temperature)

Recipes that you probably should not use ​

julia
surface(0.0005precipitation)