# NOT RUN {
df <- mtcars
p <- ggscatter(df, x = "wt", y = "mpg",
color = "mpg")
# Change gradient color
# Use one custom color
p + gradient_color("red")
# Two colors
p + gradient_color(c("blue", "red"))
# Three colors
p + gradient_color(c("blue", "white", "red"))
# Use RColorBrewer palette
p + gradient_color("RdYlBu")
# Use ggsci color palette
p + gradient_color("npg")
# }
Run the code above in your browser using DataLab