桃花长相依
我尝试将 the 替换为boxplota ridge plot,它占用的空间更少,因为:它需要宽度的一半你可以部分重叠山脊它是垂直发展的,所以你可以向下滚动所有的情节我从seaborn 文档中获取代码并对其进行了一些调整,以便拥有 60 个不同的正态分布的脊;这里的代码:import numpy as npimport pandas as pdimport seaborn as snsimport matplotlib.pyplot as pltimport itertoolssns.set(style="white", rc={"axes.facecolor": (0, 0, 0, 0)})# # Create the datan = 20x = list(np.random.randn(1, 60)[0])g = [item[0] + item[1] for item in list(itertools.product(list('ABCDEFGHIJ'), list('123456')))]df = pd.DataFrame({'x': n*x, 'g': n*g})# Initialize the FacetGrid objectpal = sns.cubehelix_palette(10, rot=-.25, light=.7)g = sns.FacetGrid(df, row="g", hue="g", aspect=15, height=.5, palette=pal)# Draw the densities in a few stepsg.map(sns.kdeplot, "x", clip_on=False, shade=True, alpha=1, lw=1.5, bw=.2)g.map(sns.kdeplot, "x", clip_on=False, color="w", lw=2, bw=.2)g.map(plt.axhline, y=0, lw=2, clip_on=False)# Define and use a simple function to label the plot in axes coordinatesdef label(x, color, label): ax = plt.gca() ax.text(0, .2, label, fontweight="bold", color=color, ha="left", va="center", transform=ax.transAxes)g.map(label, "x")# Set the subplots to overlapg.fig.subplots_adjust(hspace=-.25)# Remove axes details that don't play well with overlapg.set_titles("")g.set(yticks=[])g.despine(bottom=True, left=True)plt.show()这是我得到的结果:我不知道它是否适合您的需求,无论如何请记住,将如此多的发行版彼此相邻放置总是需要大量空间(和非常大的屏幕)。也许您可以尝试将分布分成更小的组并一次绘制一点?