Violin Plot troubles in Python on log scale

后端 未结 2 2077
伪装坚强ぢ
伪装坚强ぢ 2020-12-19 18:51

My violin plots are showing weird formats when using a log scale on my plots. I\'ve tried using matplotlib and seaborn and I get very similar results.

impor         


        
2条回答
  •  别那么骄傲
    2020-12-19 19:21

    I don't know what's up with seaborn here but the violin plot from matplotlib seems to work as expected.

    fig, ax = plt.subplots(1,3, sharey=True)
    
    ax[0].violinplot(dataset=data) # <------- matplotlib's violinplot here
    sns.swarmplot(data=data, ax=ax[1])
    sns.stripplot(data=data, ax=ax[2])
    
    plt.yscale('log')
    plt.ylim(10**(-6), 10**0)
    

提交回复
热议问题