Displaying 1 result from an estimated 1 matches for "rangey".
Did you mean:
range
2007 Dec 11
2
ggplot - Setting the y-scale in a bar plot
...tips?
Using R 2.6.1 on Windows.
Thanks for any help,
Pedro
I attach below the code I am using:
plotdata<-data.frame(x=factor(2:8), y=0.1*(2:8))
plot1<-ggplot()
plot1<-plot1+layer(data=plotdata,
mapping=aes_string(x='x',y='y'),geom='bar', stat='identity')
RangeY <-c(0,1)
YBreaks <- (0:10)*diff(RangeY)/10
YTickLabels<- as.character(YBreaks)
plot2 <- plot1 + scale_y_continuous(limits=RangeY, breaks=YBreaks,
labels=YTickLabels, expand=c(0,0))
print(plot2)