0
$\begingroup$

I have only used Mathematica's BarChart and related functions only recently and it does seem as though Mathematica is extremely cumbersome when it comes to implementing certain labels of the charts.

My codes:

BarChart3D[{{65, 59}, {51, 62}, {39, 46}, {58, 32}, {38, 41}, {33, 
30}, {32, 7}}, 
ChartLabels -> {"Health info", "Online banking", 
   "Real estate listing", "Info on jobs", "Government services", 
   "Educational content", "Job application"}, BarSpacing -> {0, 1}]

I would like to associate each label with each pair of values. There are 7 labels and 7 pairs of values. However, for such a simple task, Mathematica does a poor job in recognising so and I cannot even begin to imagine how should I modify the above code in a manner that fits my demand.

$\endgroup$
0
$\begingroup$
BarChart3D[{{65, 59}, {51, 62}, {39, 46}, {58, 32}, {38, 41}, {33, 
   30}, {32, 7}}, 
 ChartLabels -> {Placed[#, Below] &@{"Health\ninfo", 
     "Online\nbanking", "Real\nestate\nlisting", "Info\non jobs", 
     "Government\nservices", "Educational\ncontent", 
     "Job\napplication"}, None}, BarSpacing -> {0, 1}, 
 ImageSize -> 600]

enter image description here

$\endgroup$
1
$\begingroup$

This isn't obvious how to label the data at first, but if you look in the right section of the documentation, you'll find

By default, labels are associated with columns of data:

and then it gives instructions on how to change this behavior. Here's how I would style your plot

labels = {"Health info", "Online banking", "Real estate listing", 
   "Info on jobs", "Government services", "Educational content", 
   "Job application"};
data = {{65, 59}, {51, 62}, {39, 46}, {58, 32}, {38, 41}, {33, 
    30}, {32, 7}};
BarChart3D[data,
 ChartLabels -> {
   Placed[labels, Above]
   , None},
 BarSpacing -> {0, 1},
 LabelStyle -> 15]

Mathematica graphics

$\endgroup$
  • $\begingroup$ Nearly at the same time; very similar, yet a bit different. $\endgroup$ – corey979 Nov 29 '16 at 15:57

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