# devtools::install_github("tidyverse/ggplot2") # do this once
library(ggplot2)
df <- data.frame(x <- rnorm(10),
y <- rnorm(10),
fill <- rnorm(10))
ggplot(df, aes(x, y, fill = fill)) +
geom_point() +
scale_fill_gradient(low = 'white', high = 'red',
guide = guide_colorbar(frame.colour = "black", ticks.colour = "black"))
+ theme(legend.background = element_rect(fill = "light grey"))
的内容。 - Roland