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

Simon Urbanek simon.urbanek at math.uni-augsburg.de
Tue Dec 30 19:06:42 MET 2003


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

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 at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-devel
>



More information about the R-devel mailing list