[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-help
Subject:    Re: [R] plot focus
From:       Henrique Dallazuanna <wwwhsd () gmail ! com>
Date:       2010-06-30 21:37:15
Message-ID: AANLkTikEB2l2aUouIkAhnHypVmkKTyLD9sxmw7vtJ5p6 () mail ! gmail ! com
[Download RAW message or body]

Try this:

par(mfg = c(1, 1))
lines(iris[,4],col="black")

On Wed, Jun 30, 2010 at 7:26 AM, pdb <philb@philbrierley.com> wrote:

>
> I am doing calculations in a loop and then plotting the results by adding a
> point to each of 2 charts at the end of the loop. Its very informative as
> you can see the progression through time.
>
> My problem is, if I have 2 plots, I don't know how to get the focus back to
> the first plot.
>
> layout(matrix(c(1,2)))
>
> plot(iris[,1],col="red",) #plot1
> plot(iris[,3],col="blue") #plot2
>
> #goes on plot2
> lines(iris[,2],col="pink")
>
> #how do I put this line on plot 1
> lines(iris[,4],col="black")
>
>
> I tried the method below but when you switch the focus back to screen 1 the
> line gets drawn not where I expect
>
> split.screen(c(2,1))
> screen(1) # prepare screen 1 for output
> plot(iris[,1],col="red",) #plot1
> screen(2) # prepare screen 2 for output
> plot(iris[,3],col="blue") #plot2
>
> screen(1)
> lines(iris[,2],col="pink",lwd=8)
>
> screen(2)
> lines(iris[,4],col="green",lwd=8)
>
> Any pointers please as to what I need to do?
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/plot-focus-tp2272699p2272699.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

	[[alternative HTML version deleted]]



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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic