0

How can I plot multiple distribution plots in one plot where I have column = "Quantity" from 5 dataframes at nation, region, division, state and DMA level and the length of dataframes and their scale differs a lot.

I used this code:

sns.displot(data= data_vert, x='dev_median_qty', hue='level', kind='kde', fill=True, palette=sns.color_palette('bright')[:5], height=5, aspect=2.5)
plt.xlim(-5, 25)

And I got this graph :

The Graph

I want that area under each curve is one, or every level data gives same area under the curve without changing the distribution, so that this graph can be more visually sound and good to observe.

tantalum
  • 2,354
  • 1
  • 15
  • 22
  • There is a parameter `common_norm` which defaults to `True` and makes the area of all curves together sum to 1. Setting it to `False` will have the individual curves each have an area of 1. The parameter `multiple=` allows e.g. to stack the areas. See the [docs for `kind='kde'`](https://seaborn.pydata.org/generated/seaborn.kdeplot.html) – JohanC Aug 04 '22 at 22:50
  • Thanks for the answer, Also can you help me out if I want multiple x axis scales in the same plot, if I have datasets of different scales – Naman Jindal Aug 05 '22 at 05:41
  • I suppose you could make multiple plots. Combining multiple x scales in one plots could be hard to interpret. – JohanC Aug 05 '22 at 09:06

0 Answers0