Question

In R, how does one open a new graphical device (e.g., with dev.new()) with dimensions that are equal to the display dimensions?

To clarify, I would like a way to achieve the same effect as typing dev.new(), then clicking the "zoom" button (little green button) on Mac, or clicking the "maximize" button on Windows. I want the code to have this effect regardless of what computer I'm working on.

Was it helpful?

Solution

I think if you provide an overestimate for width and height you can achieve this.

For example:

dev.new(width=24, height=24)

That does depend on which device is used by default, but I think this will always work for the screen device as long as no other setting has change the units. X11 and windows and pdf and postscript use inches but png and other bitmap devices use pixels.

There is no way to resize an already open device afaik.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top