From simon.urbanek at math.uni-augsburg.de  Tue Dec 30 19:06:42 2003
From: simon.urbanek at math.uni-augsburg.de (Simon Urbanek)
Date: Tue Dec 30 19:05:19 2003
Subject: [Rd] split.screen problem with jpeg/png device (PR#6223)
In-Reply-To: <20031230153724.7877C104AF@slim.kubism.ku.dk>
References: <20031230153724.7877C104AF@slim.kubism.ku.dk>
Message-ID: <EC1B215A-3AF2-11D8-9EB3-000A959F327E@math.uni-augsburg.de>

On Dec 30, 2003, at 4:37 PM, 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))

This implicitly uses erase=TRUE and will erase previous screens on the 
device (including the top one - which is probably the bug) - if you use 
erase=FLASE then you get all four plots.
(confirmed with R-devel and png device on Darwin)

>   screen (d[1])
>   plot (1:10, main="c")
>   screen (d[2])
>   plot (1:10, main="d")
>
> close.screen (all=TRUE)
>
> dev.off()
>
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-devel
>


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