Using cowplot, this function extracts the legend from a ggplot object and places it in a separate plot below the original plot without the legend. This is useful for creating cleaner visualizations where the legend is displayed separately.
move_legend_to_separate_plot(plot, legend_rel_height = 0.4)A ggplot object with the legend placed in a separate plot.
(ggplot) A ggplot object whose legend is to be separated.
(numeric(1)) A numeric value indicating the relative height of the legend plot compared to the main plot. Default is 0.4.