From 0aea399dbbad3ba373faacc58310196311014ff5 Mon Sep 17 00:00:00 2001 From: hanneoberman Date: Wed, 23 Oct 2024 16:19:43 +0200 Subject: [PATCH] make differences in correlations more pronounced in color --- R/plot_corr.R | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/R/plot_corr.R b/R/plot_corr.R index 44a001b..c079845 100644 --- a/R/plot_corr.R +++ b/R/plot_corr.R @@ -153,10 +153,15 @@ plot_corr <- ) } if (diff) { - gg <- gg + ggplot2::scale_fill_gradient2( - low = ggplot2::alpha("deepskyblue", 1), - mid = "lightyellow", - high = ggplot2::alpha("orangered", 1), + gg <- gg + ggplot2::scale_fill_gradientn( + colors = c( + "deepskyblue4", + "deepskyblue", + "lightyellow", + "orangered", + "orangered4" + ), + values = c(0, 0.475, 0.5, 0.525, 1), na.value = "grey90", limits = c(-2, 2) )