4
$\begingroup$

I can label groups in a bar chart but when trying to rotate the column labels I get unexpected results.

This works:

BarChart[{{1, 2, 3}, {4, 5, 6}}, ChartLabels -> {{"c1", "c2"}, {"r1", "r2", "r3"}}] 

this doesn't:

BarChart[{{1, 2, 3}, {4, 5, 6}}, ChartLabels -> Placed[{{"c1", "c2"}, {"r1", "r2", "r3"}}, Axis, Rotate[#, Pi/4] &]] 

What am I doing wring?

$\endgroup$
2
  • 1
    $\begingroup$ BarChart[{{1, 2, 3}, {4, 5, 6}}, ChartLabels -> Map[Rotate[#, Pi/4] &, {{"c1", "c2"}, {"r1", "r2", "r3"}}, {2}]] $\endgroup$ Commented Mar 2, 2017 at 14:15
  • $\begingroup$ ChartLabels -> (Placed[#, Axis, Rotate[#, Pi/4] &] & /@ {{"c1", "c2"}, {"r1", "r2", "r3"}}) $\endgroup$ Commented Mar 2, 2017 at 16:27

1 Answer 1

4
$\begingroup$

Placed should be inside the List:

BarChart[{{1, 2, 3}, {4, 5, 6}}, ChartLabels -> {Placed[{"c1", "c2"}, Axis, Rotate[#, Pi/4] &], Placed[{"r1", "r2", "r3"}, Axis, Rotate[#, Pi/4] &]}] 

enter image description here

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.