Hi efisio,
Okay, you can switch devices using the dev.* functions in the grDevices
package. If you only have two devices open at one time, this is not too
difficult:
#open both devices
png(...)
par(mfrow=c(1,2))
png(...)
par(mfrow=c(1,2))
hist(...)
dev.set(dev.next())
hist(...)
dev.set(dev.next())
Thanks Jim,
actually I need to keep open two devices at the same time, and within
the loop access either of them in alternation. In MatLab there is the
command Figure(#) which keeps track of the open devices and direct the
output of the plot to whichever of them.
For example:
plot_filenames<-c(
Hi efisio,
I read this as wanting to start a new graphics device, then set some plot
parameters, display two plots and then close the graphics device at each
iteration of the loop. If so,
plot_filenames<-c("plot1.png","plot2.png","plot3.png")
for(plotfn in plot_filenames) {
png(plotfn)
par(mfrow
Dear,
cannot find a way to direct multipanel plots to different figures
(files) while within a loop.
Say, the loop creates two plots each step: one plot should go to figure
1 and the other to figure 2.
Same for the next steps of the loop: the plots should go to figure 1
and figure 2 in a m
4 matches
Mail list logo