保存图像为 pdf 格式
.pdf 的图像是矢量图,放大不会失真,但图像所需存储空间比较大
1. 基本语法
pdf(path/file=, width=, heigh=)
- width 和 heigh 的单位是inches(英寸),1 inch = 2.54 centimeter(cm)
- 注意:这里的尺寸指的是一张
2. 用法
pdf(path/file="path_1/file_1", width=100, heigh=100)
plot()
dev.off()
3. pdf()和plot_grid()联用
pdf(paste(getwd(), "/Plots_of_Marker_invaid.pdf", sep = ""), width = 13.5, height = 16) '#规定一张pdf的尺寸
for (i in 1:(length(Marker_invalid_plot_list)/12)) {
print(plot_grid(plotlist = Marker_invalid_plot_list[(18*i-17):(18*i)], byrow = T, ncol = 3, nrow = 4)) #把需要组合的图像组合在一起
}
dev.off()
- 用
plot_grid()
来组合图像
- 用
pdf()
来输出图像为
网友评论