Home > Software design >  ggplot2: Different width of bars
ggplot2: Different width of bars

Time:03-06

My dataset is at the link dataset in txt

ggplot(vojvodina2016, aes(x=uz, y=per1000, fill=grupa))  
  geom_bar(stat='identity', position='dodge')   
  scale_x_continuous(breaks = c(0,5,15, 25,35,45,55,65,75,85),
                     label = c("0", "5", "15","25", "35", "45","55", "65", "75","85 "))   
  theme_bw()

graph

However, it seems that bars are different width.

CodePudding user response:

I ran your code and obtained a graph with equal width for all bars. There is no line in your code suggesting it should be otherwise. Try printing it out with a different size/resolution.

  • Related