Skip to content

Commit

Permalink
Merge pull request #3983 from PrimozGodec/boxplot-fix
Browse files Browse the repository at this point in the history
[FIX] Boxplot fix
  • Loading branch information
ajdapretnar authored Aug 23, 2019
2 parents e218f68 + c40d42a commit 0dee6ea
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Orange/widgets/visualize/owboxplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,10 +957,13 @@ def line(x0, y0, x1, y1, *args):
var_line = line(stat.mean - stat.dev, 0, stat.mean + stat.dev, 0)
var_line.setPen(self._pen_paramet)
box.extend([whisker1, whisker2, vert_line, mean_line, var_line])
if stat.q25 is not None and stat.q75 is not None:
if stat.q25 is not None or stat.q75 is not None:
# if any of them is None it means that its value is equal to median
box_from = stat.q25 or stat.median
box_to = stat.q75 or stat.median
mbox = FilterGraphicsRectItem(
stat.conditions, stat.q25 * scale_x, -height / 2,
(stat.q75 - stat.q25) * scale_x, height)
stat.conditions, box_from * scale_x, -height / 2,
(box_to - box_from) * scale_x, height)
mbox.setBrush(self._box_brush)
mbox.setPen(QPen(Qt.NoPen))
mbox.setZValue(-200)
Expand Down

0 comments on commit 0dee6ea

Please sign in to comment.