Closed teunbrand closed 1 month ago
This PR aims to fix #3738 and replaces #5824.
Briefly, an example is included to use the rescaler argument to center a custom divergent scale. The example rendered:
rescaler
library(ggplot2) set.seed(1) df <- data.frame( x = runif(100), y = runif(100), z1 = rnorm(100), z2 = abs(rnorm(100)) ) ggplot(df, aes(x, y)) + geom_point(aes(colour = z1)) + scale_colour_gradientn( colours = c("blue", "dodgerblue", "white", "orange", "red"), rescaler = ~ scales::rescale_mid(.x, mid = 0) )
Created on 2024-05-21 with reprex v2.1.0
This PR aims to fix #3738 and replaces #5824.
Briefly, an example is included to use the
rescaler
argument to center a custom divergent scale. The example rendered:Created on 2024-05-21 with reprex v2.1.0