0

I am plotting multiple histograms over a range of values. This is an example: enter image description here

This is the code I am employing:

sns.set_theme(style="white", rc={"axes.facecolor":(0,0,0,0), 'axes.linewidth':2})
palette=sns.color_palette("Set2", 12)

##
def label(x, color, label):
    ax = plt.gca()
    ax.text(0, .2, label, color='black', fontsize=12,
            ha="left", va="center", transform=ax.transAxes)
##

g = sns.FacetGrid(df_comp, palette=palette, row="temperature", hue="temperature", aspect=9, height=1.2)
g.map_dataframe(sns.kdeplot, x="Rg", fill=True, alpha=1)
g.map_dataframe(sns.kdeplot, x="Rg", color='black')
g.fig.subplots_adjust(hspace=-.1)
g.map(label, "temperature")
g.set_titles("")
g.set(yticks=[], xlabel="")
g.despine(left=True)
plt.show()

This does not seem very appealing visually. I would like something that is seen over here: https://python.plainenglish.io/ridge-plots-with-pythons-seaborn-4de5725881af.

How would I make my plots to be more scrunched up, more overlapping, and the relative heights are more apparent?

bad_chemist
  • 283
  • 1
  • 7

0 Answers0