[R] plot problem

Daniil Ivanov daniil.ivanov at gmail.com
Sun Aug 20 22:45:44 CEST 2006


Hello.

I'm pretty much new to R and I'm trying to produce some figures.
It seems to me, that R has some asynchronous way of plotting figures.
When I run this code:

#constructs the semivariogram of SC1929
vgm1 <- variogram(SC1929~1,~U+V,puerto.map$att.data)

# trying to make new plot
dev.set(which=dev.next())
plot(vgm1)
title(main="Semivariogram",font.main=4)
dev.copy2eps(file="fig2.eps",horizontal=T)
dev.off()

R complains that
Error in title(main = "Semivariogram", font.main = 4) :
        plot.new has not been called yet

So that plot(..) hasn't been executed before call of title.

The most weird about that, if I add fix(vgm1) before
dev.set(...), everything is just fine. Why R can't just
perform commands one by one?
P.S. I use Linux version of R.

Thanks, Daniil.



More information about the R-help mailing list