问题
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