Skip to content
Prev 59472 / 63430 Next

Request for a crop option on R's standard plot context menu

Toby,

R provides more convenient ways for this - using window devices for any output other than screen is not its intended function. I would recommend using the off-screen devices devices such as pdf() or png() to generate output which also gives you far more control. Also please note that the amount of margins you include in the plots is entirely up to you, it should not be necessary to crop anything after the fact if you set mar/oma to the desired values.

That said, it is just a simple one-liner "magick::image_trim('foo.png')" to trim an image if you want to go that route.

Cheers,
Simon