chtan
2015-08-26 05:31:46 UTC
Hi,
the outliers in the boxplot do not seem to be drawn in the following extreme
scenario:
Data Value: 1, Frequency: 5
Data Value: 2, Frequency: 100
Data Value: 3, Frequency: 5
Here, Q1 = Q2 = Q3, so IQR = 0.
Data values 1 and 3 are therefore outliers according to the definition in
the api
(Refer to parameter "whis" under "boxplot":
http://matplotlib.org/api/pyplot_api.html
<http://matplotlib.org/api/pyplot_api.html> )
But the code below produces a boxplot that shows them as max-min whiskers
(rather than fliers):
import matplotlib.pyplot as plt
data = 100 * [2] + 5 * [1] + 5 * [3]
ax = plt.gca()
bp = ax.boxplot(data, showfliers=True)
for flier in bp['fliers']:
flier.set(marker='o', color='gray')
<Loading Image...>
What I though it would look like is obtained by perturbing half of the data
points 2 to 2.000001:
<Loading Image...>
Is this a bug or I'm not getting something right?
rgds
marcus
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/boxplot-behaviour-in-an-extreme-scenario-tp46027.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
the outliers in the boxplot do not seem to be drawn in the following extreme
scenario:
Data Value: 1, Frequency: 5
Data Value: 2, Frequency: 100
Data Value: 3, Frequency: 5
Here, Q1 = Q2 = Q3, so IQR = 0.
Data values 1 and 3 are therefore outliers according to the definition in
the api
(Refer to parameter "whis" under "boxplot":
http://matplotlib.org/api/pyplot_api.html
<http://matplotlib.org/api/pyplot_api.html> )
But the code below produces a boxplot that shows them as max-min whiskers
(rather than fliers):
import matplotlib.pyplot as plt
data = 100 * [2] + 5 * [1] + 5 * [3]
ax = plt.gca()
bp = ax.boxplot(data, showfliers=True)
for flier in bp['fliers']:
flier.set(marker='o', color='gray')
<Loading Image...>
What I though it would look like is obtained by perturbing half of the data
points 2 to 2.000001:
<Loading Image...>
Is this a bug or I'm not getting something right?
rgds
marcus
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/boxplot-behaviour-in-an-extreme-scenario-tp46027.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
------------------------------------------------------------------------------