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: enter image description here

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) 

enter image description here

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).


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -