[R] Making several plots using a loop function

Sarah Goslee sarah.goslee at gmail.com
Tue Jun 24 15:23:54 CEST 2014


What about

title(paste("plot", i))

?

Sarah

On Tue, Jun 24, 2014 at 9:17 AM, li li <hannah.hlx at gmail.com> wrote:
> Hi all,
>    When making a bunch of plots using a loop function, how to add title to
> reflect different plots.
> Specifically, for the code below, I generated 9 plots.  I would like to add
> a title to each plot.
> For example, the titles will be respectively, plot1, plot 2, … plot 9.
> Thank you very much!
>     Hanna
>
>
>
> par(mfrow=c(3,3), pty="s", pch=16, col="blue")
> for ( i in 1:9) {
> lm1 <-  lm(log(run_res[2:11, i]) ~ log(level))
> plot(log(level), log(run_res[2:11, i]), xlab="dllution levels",
> ylab="%PS-80")
> abline(lm1)}
>
>         [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help at 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.
>



-- 
Sarah Goslee
http://www.stringpage.com
http://www.sarahgoslee.com
http://www.functionaldiversity.org



More information about the R-help mailing list