[Rd] split.screen problem with jpeg/png device (PR#6223)

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Dec 30 19:51:42 MET 2003


The background colour is transparent with X11 and white with jpeg.
What you are doing is to replot over the whole screen, and it will erase 
the whole screen.  You just don't see that under X11 with the default bg 
colour.

If there is a problem at all, it is with X11: jpeg is working as 
documented.  (Hint: split.screen defaults to erase=TRUE.)


On Tue, 30 Dec 2003 steve_koehler at securecomputing.com wrote:

> Full_Name: Steve Koehler
> Version: 1.8.1
> OS: Solaris and Windows
> Submission from: (NULL) (192.55.214.50)
> 
> 
> In the following program, if output is sent to X11, you get all four graphs,
> but if output is sent to .jpeg, you only get the C and D graphs.  A workaround
> is to do all the screen splitting at the top, before using any screens.  This
> also
> fails with .png output.
> 
> jpeg ("test.jpeg")
> #x11()
> 
> a <- split.screen (c(2, 1))
> 
> screen (a[1])
>   b <- split.screen (c(1, 2))
>   screen (b[1])
>   plot (1:10, main="a")
>   screen (b[2])
>   plot (1:10, main="b")
> 
> screen (a[2])
>   d <- split.screen (c(1, 2))
>   screen (d[1])
>   plot (1:10, main="c")
>   screen (d[2])
>   plot (1:10, main="d")
> 
> close.screen (all=TRUE)
> 
> dev.off()


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-devel mailing list