[R] question about R - barplot function

Silvia Sitton silvia.sitton at prometeia.it
Tue Dec 10 13:04:02 CET 2002


I would ask you a question around the function "barplot"
I have a problem in the graphical output when I run, for example, this 
program (and the others like this):

postscript("copnido.ps",horizontal=F,family="Helvetica",pointsize=15.5,width=10.5,height=9)
par(mar=c(5,6,4,4))
dati <- read.table("infanzia.tab")
tasso <- cbind(dati$tasso)
barplot(tasso,beside = TRUE, space = c(0.6),col = c("blue"), axes = FALSE, 
ylim = c(25,40),horiz=FALSE)
axis(1,c(1.1,2.7,4.3,5.9,7.5),c("99-00","00-01", "01-02", "02-03", 
"03-04"),tck = 0,las = 1)
axis(2,las =2)
box()
dev.off()

The problem is only using the newer versions of the program (R 1.6) and is 
the following:
the bars which make up the plot start below the x axes (and not at the 0 
level).
For resolving this problem you must change "ylim", using 0 as first limit. 
But this changes also the graphic.

Thanks
Silvia Sitton




More information about the R-help mailing list