Wednesday 31 August 2016

ggplot2 - limit Y axis in R ggplot

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")

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...