Created
October 18, 2022 16:41
-
-
Save MCMaurer/c75e6069bd516865b63c407ccecdd65e to your computer and use it in GitHub Desktop.
How to grab colors to use in ggplot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
mtcars %>% | |
ggplot(aes(x = wt, y = mpg, color = factor(cyl))) + | |
geom_point() + | |
scale_color_manual(values = c("red", "blue", "#80DBCA")) | |
# open Digital Color Meter on Mac, find the color you want, and get the RGB values from that application | |
# then put those colors in here, and use the resulting hex code in scale_color_manual | |
rgb(red = 128, green = 219, blue = 202, maxColorValue = 255) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment