3

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"]]
J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574

3 Answers3

2

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}]
2

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

Chris Degnen
  • 30,927
  • 2
  • 54
  • 108
1

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

kglr
  • 394,356
  • 18
  • 477
  • 896