# Median marker style in BoxWhiskerChart

I was trying to adapt the BoxWhiskerChart to obtain a minimalistic quartile plot, like this:

What I obtained is the plot below that is, however, unsatisfying; the median markers should be circles, but they are instead slightly squared.

The code:

data = Table[
RandomVariate[NormalDistribution[μ, 1], 100], {μ,
RandomInteger[{-2, 2}, 10]}];
filledCircle[size_] := Graphics[{Black, Disk[]}, ImageSize -> size];
BoxWhiskerChart[data,
{{"Whiskers", Black},
{"MedianMarker", filledCircle[10], Black},
{"Fences", None}},
ChartBaseStyle -> White,
Frame -> False,
Method -> {"BoxRange" -> (Quantile[#,
Range[0, 1, 1/4], {{1/2, 0}, {0, 1}}] &)}
]


As an alternative, I've tried to rasterize the circles; the shape is now correct, but we get a lateral shift of the median marker.

filledCircle[size_] := Rasterize[Graphics[{Black, Disk[]}, ImageSize -> size]];


Does anyone have a better approach or solution? Or should I just build my own function?

-
Not sure how this helps, when I run your code the circles are definitely more circular than the ones shown in your first example, when zoomed to 300%, the left rightish quadrant has slightly octagonal edges, but the rest is circular. I'm on 8.0.4 on Linux. –  image_doctor Oct 31 '12 at 19:05
@image_doctor If I set filledCircle[50] then they look more circular, but I'm looking for a solution with smaller circles. –  VLC Oct 31 '12 at 19:12
Does filledCircle[size_] :=Style[Graphics[{Black, Disk[]}, ImageSize -> size], Antialiasing -> True] give something close to what you need? –  kguler Nov 1 '12 at 0:46

The disks aren't getting antialiased. (This is probably leaking from turning off antialiasing for the lines and rectangles.)

If you turn antialiasing back on:

filledCircle[size_] :=
Graphics[{Black, Style[Disk[], Antialiasing -> True]},
ImageSize -> size]


it should look better:

-
Thanks! It looks like that the problem is solved. I like your solution better, because it gives more freedom in defining the shape of the marker than using symbols like \[FilledCircle] and the like. –  VLC Nov 1 '12 at 8:34

I would use a FilledCircle rather than creating the Disk:

data = Table[RandomVariate[NormalDistribution[μ, 1], 100], {μ,
RandomInteger[{-2, 2}, 10]}];

BoxWhiskerChart[data,
{{"Whiskers", Black},
{"MedianMarker", Style[\[FilledCircle], 45], Black},
{"Fences", None}},
ChartBaseStyle -> White,  Frame -> False,
Method -> {"BoxRange" ->
(Quantile[#,Range[0, 1, 1/4], {{1/2, 0}, {0, 1}}] &)}
]


Here is an example with the typical format overlaid:

Show[
BoxWhiskerChart[data,
{{"Whiskers", Black},
{"MedianMarker",Style[\[FilledCircle], 30], Black},
{"Fences", None}},
ChartBaseStyle -> White, Frame -> False,
Method -> {"BoxRange" ->
(Quantile[#,Range[0, 1, 1/4], {{1/2, 0}, {0, 1}}] &)}],
BoxWhiskerChart[data, {{"Fences", None}},ChartBaseStyle ->Opacity[.75]]
]


-
But those are also shifted. –  VLC Oct 31 '12 at 19:09
what operating system are you using VLC? –  chuy Oct 31 '12 at 19:20
@chuy Os X 10.6.8 –  VLC Oct 31 '12 at 19:22
Changed to a filled circle. Looks better now I think. –  David Slater Oct 31 '12 at 19:27