user67275
user67275

Reputation: 2170

RStudio windows size

In RStudio, we can adjust the size of 4 windows (or panels): text editor, console, environment/history, files/plots/packages/help/viewer.

I frequently export plots from RStudio and paste it in MS Word or save it as an image file. My concern is that the size of the plot is different every time because I often adjust the size of panels as I need.

Is there any way that I adjust the panels' sizes to the same sizes that I did before after I randomly adjust the panel sizes? If I can specify the panel size by numbers, then I can do it, but RStudio does not provide such feature.

Upvotes: 2

Views: 2334

Answers (1)

Leo
Leo

Reputation: 198

This code writes your plot in PNG format (good for web), with a specified width, height, and resolution. (In this case, 400 pixels / 72 pixels per inch = 5.56 inches across--every time). I found this Revolutions blog post especially useful and has more detail and other formats.

png(file="YOUR_PLOT",width=400,height=350,res=72)

Upvotes: 3

Related Questions