3
$\begingroup$

enter image description here

pbdomains = <|
       "Overall " -> Around[2.6, 0.04], 
       "PB" -> Around[4.25, 0.06]
|>;

BarChart[pbdomains, ChartStyle -> "BrightBands", 
 LabelStyle -> {FontFamily -> "Times New Roman", 28, Bold, 
   GrayLevel[0]}, Frame -> True, FrameLabel -> {"", " Count"}, 
 BarSpacing -> Tiny, 
 ChartLabels -> Callout[Automatic, Above, Appearance -> "Balloon"]]
$\endgroup$
3
  • $\begingroup$ @Carl Lange . Many thanks! $\endgroup$ May 26, 2019 at 22:08
  • $\begingroup$ Add PlotRange -> {{0.5, 2.5}, All}. $\endgroup$ May 26, 2019 at 23:31
  • $\begingroup$ @Rohit Namjoshi. Thanks so much! $\endgroup$ May 27, 2019 at 3:51

3 Answers 3

2
$\begingroup$

You can use PlotRangePadding.

pbdomains = <|
       "Overall " -> Around[2.6, 0.04], 
       "PB" -> Around[4.25, 0.06]
|>;

BarChart[pbdomains, ChartStyle -> "BrightBands", 
 LabelStyle -> {FontFamily -> "Times New Roman", 28, Bold, 
   GrayLevel[0]}, Frame -> True, FrameLabel -> {"", " Count"}, 
 BarSpacing -> Tiny, 
 ChartLabels -> Callout[Automatic, Above, Appearance -> "Balloon"],
 PlotRangePadding -> {{-1.4, -1.37}, {None, Scaled[0.2]}}]

enter image description here

$\endgroup$
1
  • $\begingroup$ Thanks so much! $\endgroup$ May 27, 2019 at 13:13
2
$\begingroup$

enter image description hereBased on Rohit Namjoshi solution:

pbdomains = <|"Overall " -> Around[2.6, 0.04], 
   "PB" -> Around[4.25, 0.06]|>;

BarChart[pbdomains, ChartStyle -> "BrightBands", 
 LabelStyle -> {FontFamily -> "Times New Roman", 28, Bold, 
   GrayLevel[0]}, Frame -> True, FrameLabel -> {"", " Count"}, 
 BarSpacing -> Tiny, 
 ChartLabels -> Callout[Automatic, Above, Appearance -> "Balloon"], 
 PlotRange -> {{0.5, 2.5}, All}]
$\endgroup$
1
$\begingroup$

1. Use the (undocumented) option "FixedBarSpacing" as "FixedBarSpacing" -> True or as Method -> {"FixedBarSpacing" -> True}

BarChart[pbdomains, ChartStyle -> "BrightBands", 
  LabelStyle -> {FontFamily -> "Times New Roman", 28, Bold, 
      GrayLevel[0]}, Frame -> True, FrameLabel -> {"", " Count"}, 
  ChartLabels -> Callout[Automatic, Above, Appearance -> "Balloon"],
  "FixedBarSpacing" -> True]

`[![enter image description here][1]][1]

2. Use {pbdomains} as the first argument and use the option BarSpacing -> {Tiny, 1}:

BarChart[{pbdomains},
  BarSpacing -> { Tiny, 1},
  ChartStyle -> "BrightBands", 
  LabelStyle -> {FontFamily -> "Times New Roman", 28, Bold, GrayLevel[0]}, 
  ImageSize -> Large, Frame -> True, FrameLabel -> {"", " Count"}, 
  ChartLabels -> Callout[Automatic, Above, Appearance -> "Balloon"]]

enter image description here

$\endgroup$

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.