R 如何增加图形的大小,同时保持其元素的相对比例
我需要为出版物生成出版物图表,但是在保持其元素的相对大小的同时,我很难放大图表 出版商要求R 如何增加图形的大小,同时保持其元素的相对比例,r,graph,tiff,save,R,Graph,Tiff,Save,我需要为出版物生成出版物图表,但是在保持其元素的相对大小的同时,我很难放大图表 出版商要求 Submit the image as TIFF, at one of the following resolutions: Color: 300 dpi Grayscale: 600 dpi Line art: 1200 dpi Text-based graphics should be provided as 300 dpi, close-cropped TIFFs, sized to match p
Submit the image as TIFF, at one of the following resolutions:
Color: 300 dpi
Grayscale: 600 dpi
Line art: 1200 dpi
Text-based graphics should be provided as 300 dpi, close-cropped TIFFs, sized to match print.
To maximize the size of the figures on the PDF/reprint, figures should be submitted at the width of 2 columns (about 6.75 inches, 40 picas wide).
比如说
tiff(filename="Test1.tiff",width=400,height=400)
plot(c(2,2,4,4), c(2,4,2,4),xlim=c(0,5), ylim=c(0,10), xlab="Text xlab", ylab="Test ylab", pch=16, cex=1.5)
polygon(c(2,2,4,4),c(2,4,4,2), col="darkblue")
text(1,8,"Test")
dev.off()
tiff(filename="Test2.tiff",width=1200, height=1200)
plot(c(2,2,4,4), c(2,4,2,4),xlim=c(0,5), ylim=c(0,10), xlab="Text xlab", ylab="Test ylab", pch=16, cex=1.5)
polygon(c(2,2,4,4),c(2,4,4,2), col="darkblue")
text(1,8,"Test")
dev.off()
在本例中,测试2较大(如图形区域),但轴和标签看起来要小得多。我怎样才能纠正这个问题
非常感谢您需要更改tiff文件的分辨率。因此,请尝试以下方法:
ppi = 300
tiff("mygraph.tiff", width=6.75*ppi, height=6*ppi, res=ppi)
plot(c(2,2,4,4), c(2,4,2,4),xlim=c(0,5), ylim=c(0,10),
xlab="Text xlab", ylab="Test ylab",
pch=16, cex=1.5)
polygon(c(2,2,4,4),c(2,4,4,2), col="darkblue")
text(1,8,"Test")
dev.off()
然而,大多数(所有?)期刊也接受postscript或pdf格式。对于折线图,请使用这些矢量格式。与光栅格式不同,使用矢量格式意味着图形可以完美缩放。您需要更改tiff文件的分辨率。因此,请尝试以下方法:
ppi = 300
tiff("mygraph.tiff", width=6.75*ppi, height=6*ppi, res=ppi)
plot(c(2,2,4,4), c(2,4,2,4),xlim=c(0,5), ylim=c(0,10),
xlab="Text xlab", ylab="Test ylab",
pch=16, cex=1.5)
polygon(c(2,2,4,4),c(2,4,4,2), col="darkblue")
text(1,8,"Test")
dev.off()
然而,大多数(所有?)期刊也接受postscript或pdf格式。对于折线图,请使用这些矢量格式。与光栅格式不同,使用矢量格式意味着图形可以完美缩放。要保持打印文本的默认点大小,请将点大小缩放到所需高度的9/5 默认点大小=12点,其中1点=1/72英寸 默认高度=(480像素)/(72 ppi)=(480/72)英寸 比例因子=(12点)/(480像素/72 ppi)=(9/5)点/英寸 以下为上述示例,所需高度为6英寸:
tiff(“mygraph.tiff”,res=ppi,高度=6*ppi,宽度=6.75*ppi,点大小=6*(9/5))
要保持打印文本的默认点大小,请将点大小按所需高度的9/5进行缩放
默认点大小=12点,其中1点=1/72英寸
默认高度=(480像素)/(72 ppi)=(480/72)英寸
比例因子=(12点)/(480像素/72 ppi)=(9/5)点/英寸
以下为上述示例,所需高度为6英寸:
tiff(“mygraph.tiff”,res=ppi,高度=6*ppi,宽度=6.75*ppi,点大小=6*(9/5))
非常感谢您的回答。不幸的是,并非所有期刊都接受每股收益。宽度和高度选项中的系数6.75和6分别来自哪里?6.75来自您的问题“6.75英寸宽”。6只是我的标准默认值;)非常感谢你的回答。不幸的是,并非所有期刊都接受每股收益。宽度和高度选项中的系数6.75和6分别来自哪里?6.75来自您的问题“6.75英寸宽”。6只是我的标准默认值;)