BoxWhiskerChart Vertical Line

I have made a box plot to show the spread of past paper results for my A2 exams so I can easily see which subject need more work!

BoxWhiskerChart[data, “Outliers”, ChartLabels->{data[[All,1]]}, BarOrigin->Left, ImageSize->Medium, ChartStyle->Blue]

The above code gives me the following output:

Now, the average for an A is around 61 marks, is there a way to draw a line going from the bottom to top of the chart at the 61 mark limit. This could then give me a better indication of what sort of grade I’m hitting.

=================

=================

2 Answers
2

=================

After looking about online a bit more I found the Epilog option. To draw my lines I have added Epilog->{Directive[{Thick, Red, Dashed}], Line[{{61,0},{61,10}}]} to the end of the BoxWhiskerChart environment.

NB. The 10 in {60,10} is the height of the plot with respect to the bars. There are 9 bars plus half either side of the top two, hence 10.

You can also use the options GridLines and Method -> {“GridLinesInFront” -> True}:

SeedRandom[1];
grades = RandomInteger[{30, RandomInteger[{50, 100}]}, {7, 10}];
gridline = Median[Join @@ grades];
classes = {“Mathematics”, “History”, “English”, “Chemistry”, “Law”,
“Physics”, “Statistics”};

BoxWhiskerChart[grades, “Outliers”, ChartLabels -> classes,
BarOrigin -> Left, ChartStyle -> 10, ImageSize -> 500,
GridLines -> {{{gridline, Gray}}, None},
Method -> {“GridLinesInFront” -> True}]