[R] How to adjust the y-axis range in barplot properly

Benedikt Drosse drosse at mpipz.mpg.de
Thu Sep 22 17:49:12 CEST 2011

Hello R-Users,
it might be a rather simple problem I have, but I couldn't find any 
solution online. Thus, here is my problem:

I would like to adjust the y-axis range in a barplot, since all my 
values are >70. Therefore I would like to only visualize the y-axis from 
60-100 (example 1).
The problem is, the range of the y-axis is adjusted, but the barsize 
stays the same and vanishes from the plot area.
How can I "cut" the y-axis and the bars in a proper way. Unfortunatlely 
I dit not get "gap.barplot" function to work on the matrix in example 1.

I would be very greatful for some ideas and help,

example 1:
data <- as.matrix(rbind(c(85:90), c(75:80)))
barplot(data, beside=TRUE)
barplot(data, ylim=c(60,90), beside=TRUE)

More information about the R-help mailing list