From bceba246299dafb630ed73f5dd5ba03b7c56534a Mon Sep 17 00:00:00 2001 From: Jeffrey Starr Date: Wed, 29 Jan 2014 13:44:44 -0700 Subject: [PATCH] Added vertical lines connecting whiskers to main box --- pygal/graph/box.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pygal/graph/box.py b/pygal/graph/box.py index ca9f672..04d696c 100644 --- a/pygal/graph/box.py +++ b/pygal/graph/box.py @@ -110,6 +110,16 @@ class Box(Graph): coords=[(left_edge, self.view.y(whisker)), (left_edge + width, self.view.y(whisker))], attrib={'stroke-width': 3}) + # draw lines connecting whiskers to box (Q1 and Q3) + self.svg.line(parent_node, + coords=[(left_edge + width / 2, self.view.y(quartiles[0])), + (left_edge + width / 2, self.view.y(quartiles[1]))], + attrib={'stroke-width': 2}) + self.svg.line(parent_node, + coords=[(left_edge + width / 2, self.view.y(quartiles[4])), + (left_edge + width / 2, self.view.y(quartiles[3]))], + attrib={'stroke-width': 2}) + # box, bounded by Q1 and Q3 self.svg.node(parent_node, tag='rect',