# NOT RUN {
gf_dens(~cesd, color = ~substance, size = 1.5, data = mosaicData::HELPrct) %>%
gf_labs(
title = "Center for Epidemiologic Studies Depression measure",
subtitle = "(at baseline)",
color = "Abused substance: ",
x = "CESD score",
y = "",
caption = "Source: HELPrct"
) %>%
gf_theme(theme_classic()) %>%
gf_theme(
axis.text.y = element_blank(),
legend.position = "top",
plot.title = element_text(hjust = 0.5, color = "navy"),
plot.subtitle = element_text(hjust = 0.5, color = "navy", size = 12)
)
gf_point(eruptions ~ waiting, data = faithful, alpha = 0.5)
gf_point(eruptions ~ waiting, data = faithful, alpha = 0.5) %>%
gf_lims(x = c(65, NA), y = c(3, NA))
# modify scales using gf_refine()
data(penguins, package = "palmerpenguins")
gf_jitter(bill_length_mm ~ bill_depth_mm, color = ~species, data = penguins) %>%
gf_refine(scale_color_brewer(type = "qual", palette = 3)) %>%
gf_theme(theme_bw())
gf_jitter(bill_length_mm ~ bill_depth_mm, color = ~species, data = penguins) %>%
gf_refine(scale_color_manual(values = c("red", "navy", "limegreen"))) %>%
gf_theme(theme_bw())
# }
Run the code above in your browser using DataLab