Skip to content

Commit

Permalink
update default ggplottiing
Browse files Browse the repository at this point in the history
  • Loading branch information
jpiaskowski authored Aug 25, 2024
1 parent f918427 commit 832df85
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion settings.r
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@

# code from https://www.r-causal.org/

options(
# set default colors in ggplot2 to colorblind-friendly
# Okabe-Ito and Viridis palettes
ggplot2.discrete.colour = ggokabeito::palette_okabe_ito(),
ggplot2.discrete.fill = ggokabeito::palette_okabe_ito(),
ggplot2.continuous.colour = "viridis",
ggplot2.continuous.fill = "viridis",
# set theme font and size
book.base_family = "sans",
book.base_size = 14
)

library(ggplot2)

theme_set(theme_minimal(base_size = 15))
# set default theme
theme_set(
theme_minimal(
base_size = getOption("book.base_size"),
base_family = getOption("book.base_family")
) %+replace%
theme(
panel.grid.minor = element_blank(),
legend.position = "bottom"
)
)

0 comments on commit 832df85

Please sign in to comment.