[R] how to automatically maximize the graph window (under XP) ?

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Jul 3 14:56:58 CEST 2008


The Windows screen device is called windows(), not x11() (which is an 
alias for a cut-down version that is no longer needed).  It is not 
possible to open it to fill the screen -- there is a deliberate size limit 
of 85% of the screen size (see the help page).  Nor is it possible to 
maximize it programatically (at least by functions provided by R).

However, using the 'width' and 'height' arguments to windows() should 
enable you to choose a suitable layout.

On Thu, 3 Jul 2008, Ptit_Bleu wrote:

>
> Hello,
>
> Thanks Leandro for your solution.
> But, in fact, it doesn't match what I'm trying to do ... due to the fact
> that I didn't clearly tell you what I'm trying to do.
>
> I tested the command jpeg() but it doesn't display the curve and I need to
> see it before saving it.
>
> Here is a small example of my script :
>
> x11()
> plot(1:10,1:10, pch=20, col="lightblue", ylab="y", xlab="x", cex.axis=1.5,
> cex.lab=1.5, cex.main=1.5, cex=1.5, ylim=c(0,12))
> points(5, 8, pch=20, col="red", cex=1.5)
> smartlegend(x="right",y="bottom", inset = 0.02,
>            c("BlaBlaBlaBla", "BlaBlaBlaBla"),
>            col = c( "red", "lightblue"), pch=20, cex=1.5)
>
> The x11() command opens a graphic device whose size is 6.99999 6.99999
> (given by par("din")).
> (By the way, if I maximize the window, par("din") again gives 6.9999
> 6.99999).
> With this size, the legend is ok. But if I maximize the window, there is a
> lot of whit space in the legend box which occupies too much place.
> If I launch again the script, but without the x11() command, in a maximized
> window, the legend display is ok.
> That's why I would like to directly open a full screen graphic window before
> plotting the legend.
>
> I hope this explaination is clearer and that somebody will have a solution.
> Thanks in advance,
> Ptit Bleu.
>
> -- 
> View this message in context: http://www.nabble.com/how-to-automatically-maximize-the-graph-window-%28under-XP%29---tp18219242p18252841.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.
>

-- 
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-help mailing list