violin plot updated

This commit is contained in:
patrycjalazna 2021-04-14 00:15:37 +02:00
parent b1b21eef1b
commit c3899ae34b

View File

@ -23,20 +23,10 @@ na.omit(german_credit_risk)
# violin plot
ggplot(german_credit_risk, aes(x=Purpose, y=Age, fill=Sex)) +
geom_violin(trim=TRUE) +
stat_summary(fun = mean, geom="point", shape=25, size=2, position=position_dodge(.9)) +
geom_violin(trim=TRUE, position=position_dodge(1)) +
stat_summary(fun = mean, geom="point", shape=25, size=2) + #position=position_dodge(.9)
labs(title="Credit purpose by age", x="Purpose", y = "Age") +
scale_fill_brewer(palette="Accent") +
theme_minimal() +
theme(legend.position="bottom")
ggplot(german_credit_risk, aes(x=Purpose, y=Credit.amount, fill=Credit.amount)) +
geom_density_ridges(scale = 4) +
xlab('Purpose') +
ylab('Credit amount') +
labs('?') +
scale_fill_manual(values = wes_palette("Moonrise3")) +
theme_minimal()