0

enter image description here

I want to set the lower and upper limit in distribution plot as shown in figure(RED DOTTED AND BLACK DOTTED LINE). I am trying following code. but its not working. I have 4 columns characteristics, high limit, low limit and ID. (The shown graph generated through R language)

"""

sns.distplot(dataset['VALUE'], hist=True, kde=True, 
bins=int(180/5), color = 'darkblue', 
hist_kws={'edgecolor':'black'},
kde_kws={'linewidth': 4})

"""

RajeshM
  • 109
  • 9
  • If can help? [Limit the range of x in seaborn distplot KDE estimation](https://stackoverflow.com/questions/45911709/limit-the-range-of-x-in-seaborn-distplot-kde-estimation) – magicarm22 Jul 12 '21 at 09:31
  • It will not help. it directly cuts the graph. it is not desirable – RajeshM Jul 12 '21 at 09:35
  • @RajeshMORE Do you want to cut/clip both the histogram and KDE line at the limits? – filiabel Jul 12 '21 at 12:49
  • 1
    try this:`g = sns.distplot(...);g.axvline(x_pos, ymin=0, ymax=1, color='k', ls='--')` You can now draw a black vertical line. – r-beginners Jul 12 '21 at 13:15
  • If you just want to draw the lines, @r-beginners answer is the answer. Just a quick heads up that `sns.distplot` is deprecated, consider using `sns.displot` or `sns.histplot`. See docs [here](https://seaborn.pydata.org/generated/seaborn.distplot.html). – filiabel Jul 12 '21 at 13:50
  • You can also set explicit bins. Something like `ax = sns.displot(...., bins=np.linspace(0.05, 0.17, 11))` – JohanC Jul 12 '21 at 22:14

0 Answers0