6
$\begingroup$

Trying to adjust the plot range in bar charts produces an unwanted result where the bars extend below the baseline/below the frame:

BarChart[{1, 2, 3}, Frame -> True, PlotRange -> {All, {1.0, All}}]

enter image description here

This result interferes with frame labels:

BarChart[{1, 2, 3},
 Frame -> True,
 FrameLabel -> {"My Frame Label", None},
 PlotRange -> {All, {1.0, All}}]

enter image description here

And the bottom of the chart is not recognised when chart labels are set to Bottom (I had assumed that Bottom would be the bottom of the rendered bar).

BarChart[{1, 2, 3},
 Frame -> True,
 ChartLabels -> Placed[{"a", "b", "c"}, Bottom],
 PlotRange -> {All, {1.0, All}}]

enter image description here

Do others agree that this is either a bug or a design flaw and does anyone have any ideas for easy fixes (a fix can be made by writing my own bar chart function from primitives of course)?

Edit

Bug confirmed by WRI tech support

$\endgroup$
  • 1
    $\begingroup$ PlotRangeClipping? But that doesn't help with the labels. $\endgroup$ – Carl Woll May 7 '17 at 5:40
  • $\begingroup$ @CarlWoll doing that and Placed[...,Axis] get close. $\endgroup$ – Mike Honeychurch May 7 '17 at 6:21
  • $\begingroup$ When I remove the PlotRange->[.] option, it works all fine. Note the typo in the title (BarChat). $\endgroup$ – Romke Bontekoe May 7 '17 at 7:28
  • $\begingroup$ related/possible duplicate: PlotRange adjustments with BarChart $\endgroup$ – kglr May 7 '17 at 19:39
  • $\begingroup$ @kglr yes it is a duplicate. Although there appears to be no solution to get the labels at the bottom of the bars?? $\endgroup$ – Mike Honeychurch May 7 '17 at 23:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.