From ripley at stats.ox.ac.uk  Tue Dec 30 19:51:42 2003
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Tue Dec 30 19:51:54 2003
Subject: [Rd] split.screen problem with jpeg/png device (PR#6223)
In-Reply-To: <20031230153724.7877C104AF@slim.kubism.ku.dk>
Message-ID: <Pine.LNX.4.44.0312301848020.10469-100000@gannet.stats>

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@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@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


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