[R] question about R - barplot function

Uwe Ligges ligges at statistik.uni-dortmund.de
Tue Dec 10 14:35:06 CET 2002


Silvia Sitton wrote:
> 
> 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.

Unfortunately, your example is not reproducible (we don't have the
data), can you provide a simple (as simple as possible, without the need
for a separate data frame) reproducible example, please?
What does "newer" versions mean? R-1.6.1 is recent. And the phaenomenon
which I guessed you are talking about  (I have to guess, because I
cannot reproduce the example) is already present in the "old" version
R-1.5.1.

Uwe Ligges




More information about the R-help mailing list