1

I have tried several things, but none of them worked... The thing is that I want to create a bar graph in R. The Y axis starts in 0 but I want it starts in, let's say, 300. I have tried with ylim(300,1200), but the bars dissapear. How can I do this? thanks a lot!

size <- c(rep("peque", 2), rep("grande", 2))
rt <- c(900,910, 1000,1200)
data<- data.frame(size,rt)
barra<-ggplot(data, aes(size,rt))
barra + stat_summary(fun.y= mean, geom="bar")
  • It is not dupplicate. In that topic the user wanted to plot only a range of values. I don't want that. I only want to "cut" the y axis but including also those values for calculating the mean. – ajestudillo Nov 02 '13 at 18:36
  • 2
    Answer to that question explains differences between two solutions (limits and coord) - so it answers also your question! – Didzis Elferts Nov 02 '13 at 19:00
  • Yes! it worked! I typed something wrong when I tried for the first time. Thanks a lot – ajestudillo Nov 02 '13 at 19:43

0 Answers0