简体   繁体   中英

Rstudio plot viewer settings and ggsave

I am trying to do some precise layout and positioning of elements in a few ggplots for publication.

My current workflow of ggplot2, ggsave, load and view is quite annoying.

Is it possible to setup the plot viewer in RStudio to give the same layout as in my ggsave? I would need font sizes and other size-related options to be reproduced.

For reference, most of my plots are ggsave("fig1.png", width=8.85, height=x, units="cm", dpi=600) The heights depend on what I'm putting together.

Else, are there any good packages for producing nice sized plots for publications? ie no extra whitespace, scaling plots to fit allocated size...

The command you want is windows(width=8 /2.54, height=10 /2.54, xpinch=96, ypinch=96)

That opens a window, based on 96dpi, 8 cm wide and 10 cm high. Inside that, you can then work with the various layout tools within ggplot or whatever library you're using to get the actual layout you want. You may need to tweak linewidths/pointsizes due to the difference in monitor resolution and print resolution, but it is not too bad.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM