[R] Odp: Superimposing Multiple Vectors Plots in One Figure
petr.pikal at precheza.cz
Fri Jun 27 12:09:27 CEST 2008
you mix base and lattice graphics.
r-help-bounces at r-project.org napsal dne 27.06.2008 08:25:55:
> I have 3 vectors which I want to plot as in one plot.
> I was wondering why this code of mine only show the last vector:
> out_fname <- paste("MyPlot.png",sep="")
out_fname <- "MyPlot.png"
result is same
> trellis.device("png", color=TRUE)
here you are setting png device for lattice output
here you set png device for base graphics output
> plot(vect1,type="l",col="red",xlab="Nof Genes", ylab="RMSD")
> plot(vect3,type="l",col="green") # final graph only showed this one.
You make 3 plots to this device, each time overwriting previous plot.
Here you end png device for base graphics.
If you insist on not reading let say introduction to R, which is quite
good for any starting point, then at least look at
?par - especially mfrow, mfcol
and try to test examples which are located on help pages and go through
some links on those pages
If you want to use Lattice then you shall go through
and maybe some others and again test provided examples.
> - Gundala Viswanath
> Jakarta - Indonesia
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help