Reputation: 1522
I am trying to create a series of plots like this: I save a code (with a following structure) to a .R-file:
plot(...)
while (...) {
points(..)
}
frame()
barplot(..)
frame()
barplot()
and run it via "source path/to/file.R"
But somehow after all the commands are run, I have only one graphic window ("R Graphic Device 2 ACTIVE") which shows only the last barplot
I am using R 2.3 x86 under Windows 10
What am I doing wrong?
Upvotes: 0
Views: 443
Reputation: 20463
You should replace each call to frame()
with either dev.new()
or x11()
. For other options, try using RStudio or call layout()
.
More detail: frame()
is simply an alias to plot.new()
and will result in the completion of the current plotting window (if there is one) and advance to a new graphics frame. dev.new()
and x11()
, on the other hand, will open a new graphics device.
Upvotes: 1