[R] Adding line plot to a barplot

Nadine Kilsby nadine.kilsby at gmail.com
Mon Feb 1 07:40:57 CET 2010


Hi,
I am trying to add a line plot of barplot, and while the following script
works:

barplot(DATA1,bty='c')
par(new=T)
plot(DATA2,type="l",axes=F,xlab="",ylab="",bty='c') 
axis(4)

for some reason the y axis' do not align (the 0s are not in the same
position). Is this because I am trying to overlay plot on barplot, and is
there any way around this? 
Thanks,
Nadine



More information about the R-help mailing list