From f155376a8699ca92885625412429d07e35dfd7ea Mon Sep 17 00:00:00 2001 From: avpozzi Date: Fri, 13 Dec 2024 11:11:22 +0000 Subject: [PATCH 1/2] changed colour MESS overlayed plot + added pattern mask --- vignettes/a0_tidysdm_overview.Rmd | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/vignettes/a0_tidysdm_overview.Rmd b/vignettes/a0_tidysdm_overview.Rmd index 2234d45..ac7616e 100644 --- a/vignettes/a0_tidysdm_overview.Rmd +++ b/vignettes/a0_tidysdm_overview.Rmd @@ -797,11 +797,20 @@ lacerta_mess_future_subset[lacerta_mess_future_subset < 0] <- 1 # convert into polygon lacerta_mess_future_subset <- as.polygons(lacerta_mess_future_subset) +library(ggpattern) + # plot as a mask ggplot() + geom_spatraster(data = prediction_future) + - scale_fill_viridis_b(na.value = "transparent") + - geom_sf(data = lacerta_mess_future_subset, - fill= "lightgray", alpha = 0.5, linewidth = 0.5) + scale_fill_terrain_c() + + geom_sf_pattern(data = lacerta_mess_future_subset, + pattern = "stripe", + fill = "transparent", + pattern_fill= "black", + pattern_density = 0.02, + pattern_spacing = 0.05, + pattern_angle = 45, + alpha = 0.1, + linewidth = 0.5) ``` From 66d9dd8556530845b9b2c885aaf16d232026e001 Mon Sep 17 00:00:00 2001 From: avpozzi Date: Fri, 13 Dec 2024 11:11:59 +0000 Subject: [PATCH 2/2] added ggpattern as suggested package --- DESCRIPTION | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 88470db..23c88cf 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -69,7 +69,8 @@ Suggests: testthat (>= 3.0.0), tidyterra, vdiffr, - xgboost + xgboost, + ggpattern VignetteBuilder: knitr Config/testthat/edition: 3 LazyData: true