Skip to content

Commit 249dce5

Browse files
author
Sean Higgins
committed
Update colorblind palette
1 parent e42c4ec commit 249dce5

File tree

4 files changed

+2
-4
lines changed

4 files changed

+2
-4
lines changed
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
-13 Bytes
Binary file not shown.

scripts/set_theme_reprex.R

+2-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
# PACKAGES --------------------------------------------------------------------
88
library(tidyverse)
9+
library(ggthemes) # for colorblind palette
910
library(here)
1011

1112
# FUNCTIONS -------------------------------------------------------------------
@@ -55,9 +56,6 @@ ggsave(
5556
)
5657

5758
# Add colors and legend
58-
colorblind_palette <- c(
59-
"#999999", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7"
60-
)
6159
mtcars %>% ggplot() +
6260
geom_point(aes(y = hp, x = wt,
6361
color = as.factor(cyl)), size = 2 # bigger size to see colors
@@ -71,7 +69,7 @@ mtcars %>% ggplot() +
7169
# that would lead the points with highest x or y values to get partially cut off
7270
# so expand = expansion(mult = c(0, 0.01)) expands top/right by 1%
7371
# see https://ggplot2.tidyverse.org/reference/expansion.html
74-
scale_color_manual(values = colorblind_palette) +
72+
scale_color_colorblind() +
7573
set_theme(
7674
y_title_margin = "r = 5",
7775
x_title_margin = "t = 5",

0 commit comments

Comments
 (0)