简体   繁体   English

Rstudio plot 查看器设置和 ggsave

[英]Rstudio plot viewer settings and ggsave

I am trying to do some precise layout and positioning of elements in a few ggplots for publication.我正在尝试在一些 ggplots 中对元素进行一些精确的布局和定位以供发布。

My current workflow of ggplot2, ggsave, load and view is quite annoying.我当前的 ggplot2、ggsave、加载和查看工作流程非常烦人。

Is it possible to setup the plot viewer in RStudio to give the same layout as in my ggsave?是否可以在 RStudio 中设置 plot 查看器以提供与我的 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.作为参考,我的大部分情节都是ggsave("fig1.png", width=8.85, height=x, units="cm", dpi=600)高度取决于我放在一起的内容。

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)你想要的命令是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.这将打开一个 window,基于 96dpi、8 厘米宽和 10 厘米高。 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.在其中,您可以使用ggplot或您使用的任何库中的各种布局工具来获得所需的实际布局。 You may need to tweak linewidths/pointsizes due to the difference in monitor resolution and print resolution, but it is not too bad.由于显示器分辨率和打印分辨率的差异,您可能需要调整线宽/点大小,但这还不错。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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