# NOT RUN {
# Plot using iris data
plot_density(iris)
# Plot using random data
set.seed(1)
data <- cbind(sapply(seq.int(4L), function(x) {
runif(500, min = sample(100, 1), max = sample(1000, 1))
}))
plot_density(data)
# Add color to density area
plot_density(data, fill = "black", alpha = 0.8)
# Plot with preset ggplot2 themes
library(ggplot2)
plot_density(data, ggtheme = theme_light())
plot_density(data, ggtheme = theme_minimal(base_size = 15))
# Plot with customized theme components
plot_density(data,
theme_config = list(
"plot.background" = element_rect(fill = "yellow"),
"aspect.ratio" = 1
))
# }
Run the code above in your browser using DataLab