On 11/28/2011 05:46 PM, Vikram Bahure wrote:
Dear R users,
I want to superimpose two graphs as well as ensure that they should have
same scale with same x& y axis.
I am using following command but it does not ensure same scale.
*pdf(file = "../RESULTS/RS1.simulated.pdf", width = 10, height =6)*
*plot(Reserves.RS, col = 1:2, screen = 1)*
*par(new= TRUE)*
*barplot(RS.active, axes = FALSE)*
*dev.off()*
*
*
Hi Vikram,
Try this:
library(plotrix)
ylim<-range(c(Reserves.RS,RS.active))
twoord.plot(ly=RS.active,ry=Reserves.RS,rcol=1,type=c("bar","p"),
lylim=ylim,rylim=ylim)
I'm assuming that you have the same number of values in each vector, if
not, you may have to specify xlim as well.
Jim
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.