I get the following error message followed by instability in R after the 
error message:

        Error: Cannot pop the top-level viewport (grid and graphics output 
mixed?)

Have reduced something much more complex in my code to a simple test case. 
  I run the following and then resize the window:

X = seq (1,10)
Y = X^2

opar <- par(no.readonly=TRUE, mar = c(2.5, 3.1, 1, 2))
grid.newpage()

pushViewport (viewport(x=0,y=0,width=1,height=1,just=c(0,0), name='base'))
pushViewport (viewport(x=0,y=0.5,width=1,height=0.5,just=c(0,0)))
par (fig=gridFIG())

# plot in top half of page
plot (X,Y,col='black',xlab="",main='',cex.axis=.7)

# get toplevel view
seekViewport('base')

# create lower viewport
pushViewport(viewport(x=0,y=0,width=1, height=0.5, just=c(0,0))) 
par(new=TRUE,fig=gridFIG()) 

plot (X,Y,col='grey')

Upon resize will display the above error.   R will then become unstable 
and I have to terminate.    This is in the windows version of R 2.8.0.

Am I doing something wrong?   I am using viewports as I am doing something 
more complex than the above in code with a number of additional viewports 
(In this case I could use
layout or split.screen)

regards

Jonathan Shore



-----------------------------------------
SAVE PAPER - THINK BEFORE YOU PRINT!

This transmission has been issued by a member of the HSBC Group
"HSBC" for the information of the addressee only and should not be
reproduced and/or distributed to any other person. Each page
attached hereto must be read in conjunction with any disclaimer
which forms part of it. Unless otherwise stated, this transmission
is neither an offer nor the solicitation of an offer to sell or
purchase any investment. Its contents are based on information
obtained from sources believed to be reliable but HSBC makes no
representation and accepts no responsibility or liability as to its
completeness or accuracy.
        [[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.

Reply via email to