4
$\begingroup$

given the following data organized by year

y2011 = {121.68, 70.82, 82.62, 111.03, 76.9, 76.51, 86.07, 70.03, 
  72.14, 114.14, 135.51, 104.51}
y2012 = {97.19, 72.03, 116.25, 78.66, 89.94, 152.21, 70.03, 85.07, 
  129.75, 87.94, 125.58, 157.15}
y2013 = {154.21, 106.78, 116.62, 70.03, 121.69, 110.52, 159.96, 71.66,
   70.03, 89.14, 0, 0}

I want to draw the following diagram, grouping the data of the same months together:

BarChart[Transpose[{y2011, y2012, y2013}], 
 ChartLabels -> {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", 
   "Aug", "Sep", "Oct", "Nov", "Dec"}]

BarChart of yearly data grouped by month

How can I show just one ChartLabel per month/category?

$\endgroup$

1 Answer 1

6
$\begingroup$

You mean something like this?

BarChart[Transpose[{y2011, y2012, y2013}], 
 ChartLabels -> {Placed[{"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", 
                         "Sep", "Oct", "Nov", "Dec"}, Axis], None}]

Mathematica graphics

$\endgroup$
2
  • $\begingroup$ oh my god, answer in mere minutes, and when I try my hand at cosmetics of the answer belisarius has already done it. Great! $\endgroup$ Nov 6, 2013 at 21:05
  • $\begingroup$ What about if I've set the axis to None? Is there an alternative to Axis (analogous to "RadialOuter")? $\endgroup$
    – orome
    Nov 22, 2016 at 21:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.