Combining 2 joyplots with same x-axis

前提是你 提交于 2020-01-06 05:24:26

问题


I have a code for plotting ridgeplot (joyplot).

import joypy

fig, axes = joypy.joyplot([RZS_P['RZ'][(RZS_P['P_2001'] > range_P[i]) & (RZS_P['P_2001'] <= range_P[i]+500)] for i in range(8)],
                          ylim='own', overlap = 1, bins = 20, figsize=(6,8), alpha = 1, labels = labels,grid=True, color  ='black',
                          fill = False, lw = 2)
for i in range(len(sample)):
    plt.xlim(0,800)

######### The code below is for different data with same x-axis

fig, axes = joypy.joyplot([RZS_P['Rootzone'][(RZS_P['P_2012'] > range_P[i]) & (RZS_P['P_2012'] <= range_P[i]+500)] for i in range(8)],
                          ylim='own', overlap = 1, bins = 20, figsize=(6,8), alpha = 0.6, labels = labels,grid=True, color  ='#2c7fb8')
for i in range(len(sample)):
    plt.xlim(0,800)

What I want is something like below, but not just a overlap, but similar y-axis range for both the datasets.

What I want is to combine these 2 plots and keep their y-axis absolute to one another and not having the same height for different frequency (important). What is difficult for me is that when I try to plot them using axes[0] or something similar (like matplotlib), they just get plotted separately.

来源:https://stackoverflow.com/questions/59507923/combining-2-joyplots-with-same-x-axis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!