• R语言
  • 关于R画图plot的两个问题

1.在通过调整我的plot窗口大小后怎样保存窗口的大小与设置

2.如何利用上述1中的大小设置等参数来设置plot窗口大小





最近论文要用到画图,但是好像plot默认的是一种图大小,想利用上述1和2通过手动设置一个画图模板,以后每次调用就可以了

那这个长宽怎样计算,比如说要200dpi怎样设置?
如果是论文的话,可以用pdf格式啊。
<br />
?pdf<br />
pdf            package:grDevices            R Documentation(latin1)<br />
<br />
PDF Graphics Device<br />
<br />
Description:<br />
<br />
     'pdf' starts the graphics device driver for producing PDF<br />
     graphics.<br />
<br />
Usage:<br />
<br />
     pdf(file = ifelse(onefile, "Rplots.pdf", "Rplot%03d.pdf"),<br />
         width, height, onefile, family, title, fonts, version,<br />
         paper, encoding, bg, fg, pointsize, pagecentre, colormodel,<br />
         useDingbats, useKerning)<br />
<br />
width, height: the width and height of the graphics region in inches. <br />
          The default values are '7'.<br />


其中width和height可以用来定义图画背景的大小,但是pdf和png设备的不同之处在于pdf的尺寸是英寸(默认),png的尺寸默认的是像素(pix),但是也可以通过 units(units: The units in which 'height' and 'width' are given.  Can be

          'px' (pixels, the default), 'in' (inches), 'cm' or 'mm'.)设置。
18 天 后
调整后运行,下面获取作图宽度和高度参数,保存在对象fin中,以后作图前x11(fin[1],fin[2])即可。

par('fin')->fin



x11(fin[1],fin[2])