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

From: Prof Brian Ripley <>
Date: Thu, 03 Jul 2008 13:56:58 +0100 (BST)

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:
> Sent from the R help mailing list archive at
> ______________________________________________
> mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 03 Jul 2008 - 13:01:37 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 03 Jul 2008 - 13:31:28 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive