I used the code below to generate the image attached to this question:

import seaborn as sns
plot = sns.displot(data=df, col='threshold', col_wrap=2, x='predicted_synonym_count', hue='has_synonym', multiple='stack', binwidth=0.5)

The image is extremely tall because the top two plots, especially the one labeled threshold=0.02, have very tall bins. None of the other plots have bins that are that tall, but they all have the same y-axis range as the top two images. Is it possible using a seaborn displot or something similar to reduce the size of the y-axis for the lower eight plots while keeping the top two plots as they are?

A displot consisting of ten histograms representing the predicted number of synonyms for each label, colored according to whether the label has any actual synonyms.

UPDATE: I made a version of the plot I'm looking for in Krita out of the original plot, so that you can see what my goal is. It is below.

A modified version of the displot above, in which the heights of each histogram pair are adjusted based on the maximum bin height.

  • 2
    $\begingroup$ Check out this Stack Overflow answer. $\endgroup$
    – m13op22
    Commented Jun 15, 2023 at 20:56
  • $\begingroup$ That's very helpful and good to know about, but what I would really like would be if I could have them at the same scale, but with different heights, as opposed to at the same heights with different scales. $\endgroup$
    – Zorgoth
    Commented Jun 15, 2023 at 21:03


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.