Specify Width and Height of Plot

Ryan R. Rosario picture Ryan R. Rosario · Aug 14, 2009 · Viewed 76.1k times · Source

I have a panel containing three plots. How can I use par to specify the width and height of the main panel so it is always at a fixed size?

Answer

Dirk Eddelbuettel picture Dirk Eddelbuettel · Aug 14, 2009

You do that in the device, e.g.

x11(width=4, height=6)

and similarly for the file-based ones

pdf("/tmp/foo.pdf", width=4, height=6)

You can read the physical size via par("cin") etc but not set it.