diff --git a/scripts/02_simulation/07_plot_RYE_values.R b/scripts/02_simulation/07_plot_RYE_values.R index b310b12..7d05131 100644 --- a/scripts/02_simulation/07_plot_RYE_values.R +++ b/scripts/02_simulation/07_plot_RYE_values.R @@ -74,7 +74,7 @@ p1 <- plot(p1) # export as a .svg file -ggsave(filename = "figures/SI2_fig_S2.svg", p1, +ggsave(filename = "figures/SI2_fig_S2.pdf", p1, unit = "cm", width = 20, height = 14) # check the range of RYEs for alpha = 3 @@ -83,4 +83,30 @@ dd_df %>% summarise(min = min(RYe), max = max(RYe)) +# plot a single one of these with alpha = 3 +p2 <- + ggplot(data = dd_df |> dplyr::filter(alpha_3 == "yes"), + mapping = aes(x = Species, y = RYe, group = group)) + + geom_line(alpha = 0.1) + + scale_x_discrete(expand = c(0.05, 0.05)) + + scale_y_continuous(limits = c(0, 1)) + + xlab("Species") + + ylab(bquote("RY"[E])) + + theme_meta() + + theme( + panel.background = element_rect(fill='transparent'), #transparent panel bg + plot.background = element_rect(fill='transparent', color=NA), #transparent plot bg + panel.grid.major = element_blank(), #remove major gridlines + panel.grid.minor = element_blank(), #remove minor gridlines + legend.background = element_rect(fill='transparent'), #transparent legend bg + legend.box.background = element_rect(fill='transparent') #transparent legend panel +) + +# export the figure for further modification +ggsave(filename = "figures/def_fig_6.pdf", p2, + unit = "cm", width = 10, height = 8, bg = "transparent") + + + + ### END diff --git a/scripts/03_empirical_analysis/02_case_study_2/03_data_analysis/08_analyse_BEF_effects.R b/scripts/03_empirical_analysis/02_case_study_2/03_data_analysis/08_analyse_BEF_effects.R index 425b0b9..1a83204 100644 --- a/scripts/03_empirical_analysis/02_case_study_2/03_data_analysis/08_analyse_BEF_effects.R +++ b/scripts/03_empirical_analysis/02_case_study_2/03_data_analysis/08_analyse_BEF_effects.R @@ -252,7 +252,7 @@ p123 <- rel_heights = c(1.5, 1, 2)) plot(p123) -ggsave(filename = "figures/MAIN_fig_4.svg", +ggsave(filename = "figures/MAIN_fig_4.pdf", p123, units = "cm", width = 13, height = 18) # add a plot for the defence @@ -347,6 +347,21 @@ p1 <- theme_meta() plot(p1) +# export a plot for the defence +p4_def <- + p1 + + theme( + panel.background = element_rect(fill='transparent'), #transparent panel bg + plot.background = element_rect(fill='transparent', color=NA), #transparent plot bg + panel.grid.major = element_blank(), #remove major gridlines + panel.grid.minor = element_blank(), #remove minor gridlines + legend.background = element_rect(fill='transparent'), #transparent legend bg + legend.box.background = element_rect(fill='transparent') #transparent legend panel + ) + +ggsave(filename = "figures/def_fig_2.pdf", p4_def, + unit = "cm", width = 10, height = 8, bg = "transparent") + slope_sum <- lm_df %>% summarise(slope_m = mean(slope),