Currently, I cannot check how this worked in version 8, but in version 9, me too was struggling with those ticks.
Possibly there is direct way, I'd be happy to see that. Or as you suggest, maybe it is a bug, I cannot tell.
NOTE: for removing the ticks, see the link I posted (Opacity[0]
seems to do the trick)
Though, it makes sense to me that in a bar chart the ticks on the "bar number" axis, as you call it, are not very relevant (as there is no scale, I guess).
Still, here's a possible workaround, using standard charting functions & options, maybe that will help you...
My plan was to use ListLinePlot
, as there we do have a fully functional x-axis. Thus:
points = {1, -2, 2, -3, 3, -4}
are the "bars" we want to plot. As in your example, we partition in groups of two bars each and fill with zeros between groups (and prepend, append zero) so that ListLinePlot
looks better:
pts = Flatten@
Riffle[ConstantArray[0, (Length@points)/2 + 1], points~Partition~2]
In order to have more control where the bars are (we could use standard ListPlot
option: " assumed to correspond to x coordinates 1, 2,...", we can for instance use:
MapIndexed[{First[#2] - 1, #} &, pts]
to get
{{0, 0}, {1, 1}, {2, -2}, {3, 0}, {4, 2}, {5, -3}, {6, 0}, {7,
3}, {8, -4}, {9, 0}}
and we are ready to plot:
ListLinePlot[MapIndexed[{First[#2] - 1, #} &, pts],
InterpolationOrder -> 0, Filling -> Axis,
FillingStyle -> {LightRed, LightGreen}, PlotStyle -> {Thin, Gray},
AxesOrigin -> {0.5, 0},
Ticks -> {{
{1.5, "Max 1", {0, 0.4}, LightGreen},
{2.5, "Min 1", {0, 0.4}, LightRed},
{4.5, "Max 2", {0, 0.4}, LightGreen},
{5.5, "Min 2", {0, 0.4}, LightRed},
{7.5, "Max 3", {0, 0.4}, LightGreen},
{8.5, "Min 3", {0, 0.4}, LightRed}}, None}]
which looks like:
