A density plot on the fly:

cols <- c(“#2ECBE9”, “#E998D1”, “#F5B7AB”)cols <- c("#2ECBE9", "#E998D1", "#F5B7AB")
ggplot(df, aes(x = df$Sepal.Length, fill = df$Species)) +
geom_density(alpha = 0.8, color = NA) +
scale_fill_manual(name = "Species",values = cols) + labs(y = "Petal length (cm)", x = "Sepal length (cm)")

The defaults size of the fonts are not good for eyes, so let’s customize the configurations:

mt= theme(
axis.title.x = element_text(size = 16),
axis.text.x = element_text(size = 16),
axis.text.y = element_text(size = 16),
axis.title.y = element_text(size = 16),
legend.text=element_text(size=16))

and append to the plot:

plot + mt

--

--

infoart.ca

infoart.ca

Center for Social Capital & Environmental Research | Doing research with a purpose