matplotlib - Python Violin Plots -
how can violin plots can in r using ggplot2
? in ggplot2
can create nice violin plots like:
ggplot(dat,aes(value,prob)) + geom_violin() + geom_jitter(alpha=0.1) + scale_y_log10() + labs(x="test values", y="prob")
and can obtain nice plots this:
how can same in python? i've looked @ matplotlib.pyplot.violinplot
not able similar this.
using seaborn (note using development version; things work little different in current release, violinplots):
sns.violinplot(x=value, y=prob, inner=none, color="white", cut=0) sns.stripplot(x=value, y=prob, jitter=.3, color="black", alpha=.1, size=4)
the functions both return matplotlib axes object, , can ax.set_yscale("log")
on object use log axis. note sets scale after fitting kde (i'm not sure ggplot does).