Plots: bars side by side

Hi there, I desperately try to label the individual bars, as in the original example 20, 25, … etc. I tried adding series_annotations like this

using StatsPlots

men = [20, 35, 30, 35, 27]
women = [25, 32, 34, 20, 25]
std_men = [2, 3, 4, 1, 2]
std_women = [3, 5, 2, 3, 3]

groupedbar(
  ["G1", "G2", "G3", "G4", "G5"],
  [men women],
  yerr = [std_men std_women],
  series_annotations = [string.(men), string.(women)]
)

results in a plot with misaligned annotations:
Screenshot from 2020-09-19 22-17-31
A second run results in a plot with the top cut off and an error message
“GKS: Rectangle definition is invalid in routine SET_VIEWPORT” .
Please help!

1 Like