2
$\begingroup$

I have a stacked barchart like this one:

BarChart[{{1, 3, 5}, {4, 7, 9}}, ChartLayout -> "Stacked"]

Is there a way to change the space before and after the bars (eg. make it smaller)? As far as I know with BarSpacing you can only change the space between the bars.

$\endgroup$
0

1 Answer 1

1
$\begingroup$

Adjust the PlotRange, e.g.

BarChart[{{1, 3, 5}, {4, 7, 9}},
 Frame -> True,
 ChartLayout -> "Stacked",
 PlotRange -> {{0.5, 2.5}, All},
 PlotRangePadding -> {{0, 0}, {0, Automatic}}]

Note that I set PlotRangePadding to zero to make it easier to see the plot range changes.

enter image description here

$\endgroup$
1
  • $\begingroup$ Oh wow thanks so easy. I was not expecting that. So i just missed PlotRange $\endgroup$
    – M.A.
    Nov 13, 2018 at 20:47

Your Answer

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

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