Bug introduced in 9.0 and fixed in 9.0.1
I want to generate a simple 3D view of some frequencies for two variables. I have the counts in a 4x3 matrix, say. This is my bar chart code:
BarChart3D[
Map[Labeled[#, Text[Style[#, Black, Opacity[1.], Bold, 20]],
Above] &, {{1, 0, 2}, {0, 0, 2}, {2, 1, 0}, {0, 2, 1}}, {2}],
ChartLayout -> "Grid",
BarSpacing -> Large,
ChartElements -> Graphics3D[Cylinder[]],
ChartStyle -> Directive[Opacity[0.3]],
AxesLabel -> {None, None, None},
Ticks -> {{{1/2, "Del"}, {2, "Nor"}, {2 + 3/2, "Amp"}},
{{1/2, "Osteo"}, {1.75, "Ewing"}, {3, "Rhabdo"}, {4.25,
"Neuro"}}, {0, 1, 2}},
ViewPoint -> {1.3`, -2.4`, 2.`}
]
And this is what I got with Mathematica 9.0 (more precisely, 9.0.0.0 Mac OS X.)
- First, for readability, I want to place a label in each column. But as you can see, zeroes are not displayed. How can I get BarChart3D to plot my zeros? Or probably better, to draw a flat disk in corresponding place.
- (Not as important) Notice how I placed the ticks for the x and y axes. The matrix is 4x3, so I don't understand where those positions come from (the ones I had to use to put the labels - see
Ticks
above). My guess is that my positions are probably wrong, although visually seem ok for now.
Help would be much appreciated.
Update
As workaround for zeros, I put a If[#==0,0.01,Labeled[...]]
in Map
and displays ok. Still, I am intrigued on how to position tick labels correctly, with Ticks
or some other option.
Trace
but it was quite complicated. I'll try to work out the source of the exact positions of the elements later, if someone doesn't beat me to it. $\endgroup$