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...)
SDM Layer with 1497697 Int16 cells
	Proj string: +proj=longlat +datum=WGS84 +no_defs
	Grid size: (1180, 1741)

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)