Hi,
Unfortunatly I have another question...
I would like to plot, together, a mean function ("plot(...)" below)
and the barplot of the sample size at each x-point ("barplot(...)"
below). The 3d column, "ax", corresponds to the x-axis marks.
---------------------------------------
z_data.frame(size=c(3720,16962,11627,9676),mean=c(.6,.7,.3,.5),ax=0:3)
z
par(omi=c(0,.3,0,.3))
par(mar=c(5,5,4,4))
barplot(z$size,names=as.character(z$ax))
par(new=T)
par(omi=c(0,.3,0,.3))
par(mar=c(5,5,4,4))
plot(z$ax,z$mean,type="l",xlab="Age",ylab="",lwd=3,cex=1.1)
---------------------------------------
My problem is that there is a gap between the barplot x-axis and the
plot x-axis: the 0, 1, etc. are not superposed. I would like to have
the same 0, 1, 2 and 3 on x-axis for the (first point of the) plot and the
(middle
of the 1rst bar of the) barplot.
I played with hist, break, par... without any success.
Thank you for your help,
Tristan
--------------------
> par(omi=c(0,.3,0,.3))
> par(mar=c(5,5,4,4))
> barplot(z$size,names=as.character(z$ax))
> par(new=T)
> par(omi=c(0,.3,0,.3))
> par(mar=c(5,5,4,4))
> plot(z$ax,z$mean,type="l",ylim=c(.3,.8),xlim=c(0,30),xlab="Âge",ylab="",lwd=3,cex=1.1)
-------------------
--
Laboratoire Central des Ponts et Chaussées
[Division ESAR ? Section AGR]
Route de Bouaye BP 4129
44341 Bouguenais Cedex
France
Tél 33 (0)2 40 84 56 18
Fax 33 (0)2 40 84 59 92
|