# Small function to display plots only if it's interactive
p_ <- GGally::print_if_interactive
data(tips)
p_(ggally_density(tips, mapping = ggplot2::aes(x = total_bill, y = tip)))
p_(ggally_density(
tips,
mapping = ggplot2::aes(total_bill, tip, fill = after_stat(level))
))
p_(ggally_density(
tips,
mapping = ggplot2::aes(total_bill, tip, fill = after_stat(level))
) + ggplot2::scale_fill_gradient(breaks = c(0.05, 0.1, 0.15, 0.2)))
Run the code above in your browser using DataLab