Re: [R] multiple plots with par mfg

From: Romain Francois <francoisromain_at_free.fr>
Date: Wed 24 May 2006 - 06:47:44 EST

Hi,

An other possibility might be to use two devices and use dev.set to go from one to another :

x11() # the first device (may be windows() or quartz() depending on you OS) plot(1,1, col="blue") # blue plot
x11() # the second
plot(1.2,1.2, col="red") # red plot
points(1.1,1.1) # appears to bottom left of red point

dev.set(dev.prev()) # switch plots
points(1.1,1.1)

Le 23.05.2006 17:54, Yan Wong a écrit :
> On 23 May 2006, at 15:57, Greg Snow wrote:
>
>
>> The best thing to do is to create the first plot, add everything to
>> the
>> first plot that you need to, then go on to the 2nd plot, etc.
>>
>
> Yes, I realise that. The problem is that the data are being simulated
> on the fly, and I wish to display multiple plots which are updated as
> the simulation progresses. So I do need to return to each plot on
> every generation of the simulation.
>
>
>> If you
>> really need to go back to the first plot to add things after plotting
>> the 2nd plot then here are a couple of ideas:
>>
>> Look at the examples for the cnvrt.coords function in the
>> TeachingDemos
>> package (my quick test showed they work with layout as well as
>> par(mfrow=...)).
>>
>> The other option is when you use par(mfg) to go back to a previous
>> plot
>> you also need to reset the usr coordinates, for example:
>>
>
> Aha. I didn't realise that the usr coordinates could be stored and
> reset using par.
>
>
>> Hope this helps,
>>
>
> I think that's exactly what I need. Thank you very much.
>
> Yan
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>
>

-- 
visit the R Graph Gallery : http://addictedtor.free.fr/graphiques
mixmod 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php
+---------------------------------------------------------------+
| Romain FRANCOIS - http://francoisromain.free.fr               |
| Doctorant INRIA Futurs / EDF                                  |
+---------------------------------------------------------------+

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Wed May 24 06:48:46 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 25 May 2006 - 02:10:25 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.