kassambara / ggcorrplot

Visualization of a correlation matrix using ggplot2
https://rpkgs.datanovia.com/ggcorrplot/
186 stars 35 forks source link

adding a fill scale produces message #52

Open glocke-senda opened 9 months ago

glocke-senda commented 9 months ago

cf. Scaling colors according to the actual range of values #9

The solution recommended here produces a message. This (probably) won't lead to the downfall of civilization, but it does mess with rmarkdown rendering. (Setting message=F in chunk options made my tabset work correctly.)

For my purposes, it would be enough if the colors argument could accept a vector longer than 3.

reprex:

tibble(
  count = 1:10, 
  unif = runif(10, max=count),
  norm = rnorm(10, mean=count, sd=4)
) %>% 
  cor() %>% 
  ggcorrplot() + 
  scale_fill_gradientn(
    colors = RColorBrewer::brewer.pal(11, "RdBu"),
    limits = c(-1,1)
  )

image

Scale for fill is already present.
Adding another scale for fill, which will replace the existing scale.