Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

Commit

Permalink
πŸ§‘β€πŸ« fix the doc
Browse files Browse the repository at this point in the history
  • Loading branch information
tpoisot committed Oct 15, 2021
1 parent 3ae9323 commit 86e04a2
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ test/gallery/scatter.png

# VS Code settings
.vscode/settings.json
.vscode/launch.json
58 changes: 45 additions & 13 deletions docs/src/examples/multivariate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ layer2 = convert(
# The landcover data are finer than the other layers, so we will coarsen them.
# Because of rounding issues, the left and right cordinates need to be rounded.

layer3 = coarsen(convert(
Float16, SimpleSDMPredictor(EarthEnv, LandCover, 9; boundaries...)
), mean, (5, 5))
layer3 = coarsen(
convert(Float16, SimpleSDMPredictor(EarthEnv, LandCover, 9; boundaries...)),
mean,
(5, 5),
)
layer3.left = round(layer3.left; digits=0)
layer3.right = round(layer3.right; digits=0)

Expand Down Expand Up @@ -77,7 +79,14 @@ plot(pl1, pl2; layout=@layout [a{0.75w} b])
# to make the legend fit, but also use more classes in the map to have a
# smoother result.

p1 = bivariate(layer1, layer3; classes=6, bv_pal_2..., frame=:box, xlim=(-24, maximum(longitudes(layer1))))
p1 = bivariate(
layer1,
layer3;
classes=6,
bv_pal_2...,
frame=:box,
xlim=(-24, maximum(longitudes(layer1))),
)
xaxis!(p1, "Longitude")
yaxis!(p1, "Latitude")
p2 = bivariatelegend!(
Expand Down Expand Up @@ -110,16 +119,39 @@ trivariatelegend(layer1, layer2, layer3; quantiles=true, simplex=true)
# The legend function admits three additional arguments for the names of the
# `red`, `green`, and `blue` channels:

trivariatelegend(layer1, layer2, layer3; quantiles=true, simplex=true, red="Heterogeneous", green="Rough", blue="Urbanized")
trivariatelegend(
layer1,
layer2,
layer3;
quantiles=true,
simplex=true,
red="Heterogeneous",
green="Rough",
blue="Urbanized",
)

# We can also combine the two elements. For reasons that are not completely
# clear, the `trivariatelegend!` method makes the whole script hang, so the best
# we can currently do is to put the legend next to the plot. This will be fixed
# in a future release.
# We can also combine the two elements:

tri1 = trivariate(layer1, layer2, layer3; xlim=(-24, maximum(longitudes(layer1))))
tri1 = trivariate(
layer1,
layer2,
layer3;
xlim=(-24, maximum(longitudes(layer1))),
frame=:grid,
grid=false,
simplex=false,
)
xaxis!(tri1, "Longitude")
yaxis!(tri1, "Latitude")
tri2 = trivariatelegend(layer1, layer2, layer3; red="Heterogeneity", green="Roughness", blue="Urban")

plot(tri1, tri2; layout=@layout [a{0.5w} b])
tri2 = trivariatelegend!(
layer1,
layer2,
layer3;
inset=(1, bbox(0.01, 0.03, 0.35, 0.35, :top, :left)),
subplot=2,
red="Heterogeneity",
green="Roughness",
blue="Urban",
annotationfontsize=6,
simplex=false,
)

2 comments on commit 86e04a2

@tpoisot
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/46961

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.8.3 -m "<description of version>" 86e04a29667d45a4582ccd3b557bcdd7367e7b88
git push origin v0.8.3

Please sign in to comment.