You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Boxplot draws whiskers above/below max/min values. #720
The whiskers must end at an observed data point, but can be defined in various ways.
In the most straightforward method, the boundary of the lower whisker is the minimum value of the data set, and the boundary of the upper whisker is the maximum value of the data set.
(snip)
Another popular choice for the boundaries of the whiskers is based on the 1.5 IQR value. From above the upper quartile (Q3), a distance of 1.5 times the IQR is measured out and a whisker is drawn up to the largest observed data point from the dataset that falls within this distance. Similarly, a distance of 1.5 times the IQR is measured out below the lower quartile (Q1) and a whisker is drawn down to the lowest observed data point from the dataset that falls within this distance. Because the whiskers must end at an observed data point, the whisker lengths can look unequal, even though 1.5 IQR is the same for both sides.
@nielsle don't you think in case of an outlier the whisper should be at the smallest actual data-point within fences ? Because that seems to be the standard, or are you sure that whisper should be at the fence (not an actual datapoint) ?
Activity
nielsle commentedon Feb 2, 2026
I am no a maintainer, but for future reference the relevant code is here
https://github.com/plotters-rs/plotters/blob/master/plotters/src/data/quartiles.rs#L50-L55
The code calculates the lower fence correctly, but it needs to distinguish between "lower fence" and "left whisker position"
(Furthermore he median is usually the average of the two center datapoints if the number of datapoints are equal)
nielsle commentedon Feb 2, 2026
The following old version has the correct median, but the wrong position of left whiskers
https://github.com/plotters-rs/plotters/blob/298862ee4d76debc275d12e59b2fe25ea33f5373/src/data/quartiles.rs
hunxjunedo commentedon Feb 7, 2026
@AaronErhardt I'd like to work on this, mind assigning ?
nielsle commentedon Feb 8, 2026
I don´t think that you have to wait for Aaron. I can almost guarantee that nobody is working on this.
hunxjunedo commentedon Feb 8, 2026
I can raise a PR but not sure if anyone from the team will review it.
hunxjunedo commentedon Feb 9, 2026
@nielsle don't you think in case of an outlier the whisper should be at the smallest actual data-point within fences ? Because that seems to be the standard, or are you sure that whisper should be at the fence (not an actual datapoint) ?
nielsle commentedon Feb 10, 2026
Hmm.. you are right.
By the way #237 has some prior work on box-plots, but I think that you need to contact the author if you want to borrow code....
hunxjunedo commentedon Jul 17, 2026
@nielsle @your-diary sorry for the delay guys, completely forgot this one.