Closed lpantano closed 9 years ago
http://nxn.se/post/97650612370/high-contrast-stacked-distribution-plots
figsize(6, 8) xx = np.linspace(df.min().min(), df.max().max(), 256) yy = None offset = 0 offs = [offset] for i in df: if yy is not None: offset += 0.5 * yy.max() offs.append(offset)
s = df[i] f = kde.gaussian_kde(s) yy = f(xx) plt.fill_between(xx, yy + offset, 0 * yy + offset, zorder=-i, facecolor='k', edgecolor='w', lw=3) plt.axhline(y=offset, zorder=-i, linestyle='-', color='k', lw=4)
sns.despine(left=True, bottom=True) plt.yticks(offs, ['Sample {}'.format(s + 1) for s in df.columns]);
plt.tight_layout() plt.savefig('plots/3.png');
http://nxn.se/post/97650612370/high-contrast-stacked-distribution-plots
figsize(6, 8) xx = np.linspace(df.min().min(), df.max().max(), 256) yy = None offset = 0 offs = [offset] for i in df: if yy is not None: offset += 0.5 * yy.max() offs.append(offset)
sns.despine(left=True, bottom=True) plt.yticks(offs, ['Sample {}'.format(s + 1) for s in df.columns]);
plt.tight_layout() plt.savefig('plots/3.png');