On Jan 7, 2010, at 11:24 AM, Trafim Vanishek wrote:

Dear all,

I would like to ask you if there is a possibility in R to give the names to
graphs which are not const.
For example,

How to name each plot, or to add notes like a=x[i], b=y[i] in this cycle

x<-c(1,2,3,4,5,6)
y<-c(7,8,9,10,11,12)

par(mfrow=c(2,3))

for (i in 1:6){
plot(x,y)
}

This might be what you want:

> x<-c(1,2,3,4,5,6)
> y<-c(7,8,9,10,11,12)
>
> par(mfrow=c(2,3))
>
> for (i in 1:6){
+ plot(x,y, main=paste("this is plot # ", i, sep=""))
+ }
>

I initially thought you wanted the object names to be different for which this answer would not be responsive and no answer could be provided since that is not how base graphics work. For that you would need grid, lattice, or ggplot methods.


David Winsemius, MD
Heritage Laboratories
West Hartford, CT

______________________________________________
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.

Reply via email to