violin plot updated
This commit is contained in:
parent
b1b21eef1b
commit
c3899ae34b
14
projekt.R
14
projekt.R
@ -23,20 +23,10 @@ na.omit(german_credit_risk)
|
|||||||
|
|
||||||
# violin plot
|
# violin plot
|
||||||
ggplot(german_credit_risk, aes(x=Purpose, y=Age, fill=Sex)) +
|
ggplot(german_credit_risk, aes(x=Purpose, y=Age, fill=Sex)) +
|
||||||
geom_violin(trim=TRUE) +
|
geom_violin(trim=TRUE, position=position_dodge(1)) +
|
||||||
stat_summary(fun = mean, geom="point", shape=25, size=2, position=position_dodge(.9)) +
|
stat_summary(fun = mean, geom="point", shape=25, size=2) + #position=position_dodge(.9)
|
||||||
labs(title="Credit purpose by age", x="Purpose", y = "Age") +
|
labs(title="Credit purpose by age", x="Purpose", y = "Age") +
|
||||||
scale_fill_brewer(palette="Accent") +
|
scale_fill_brewer(palette="Accent") +
|
||||||
theme_minimal() +
|
theme_minimal() +
|
||||||
theme(legend.position="bottom")
|
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()
|
|
||||||
|
Loading…
Reference in New Issue
Block a user