Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Gökhan Sever <gokhansever@gm...>  20090914 18:50:09

On Mon, Sep 14, 2009 at 12:30 PM, <jasonsage@...> wrote: > I tried the following (most output text is deleted): > > In [1]: ob1=[1,1,2,2,1,2,4,3,2,2,2,3,4,5,6,7,8,9,7,6,4,5,5] > In [2]: import matplotlib.pyplot as > plt > In [3]: > plt.figure() > In [4]: > plt.boxplot(ob1) > In [5]: > plt.savefig('test.png') > In [6]: import > scipy.stats > In [7]: > scipy.stats.scoreatpercentile(ob1,75) > Out[7]: 5.5 > > > Note that the 75th percentile is 5.5. R agrees with this calculation. > However, in the boxplot, the top of the box is around 6, not 5.5. Isn't > the top of the box supposed to be at the 75th percentile? > > Thanks, > > Jason > >  > Jason Grout > > >From matplotlib/lib/matplotlib/axes.py You can see how matplotlib calculating percentiles. And yes it doesn't conform with scipy's scoreatpercentile() # get median and quartiles q1, med, q3 = mlab.prctile(d,[25,50,75]) I[36]: q1 O[36]: 2.0 I[37]: med O[37]: 4.0 I[38]: q3 O[38]: 6.0 Could this be due to a rounding? I don't know, but I am curious to hear the explanations for this discrepancy.  Gökhan 