R语言—图形基础

       将数据变成图表,进行数据分析,文字少,分析结果简洁明了,能够提高人们的视觉效应,能更快读取原始数据,合理的使用图表,能够提升人们对数据的理解能力,节约阅览的时间。本节细致归纳了绘制图形并保存中涉及的基本参数以及实例。


绘图参数及参数
函 数
参 数

函 数
参 数
bmp() bmp(filename = “Rplot%03d.bmp”,width = 480, height = 480,units = “px”, pointsize = 12,bg = “white”,res =NA, family ="",restoreConsole = TRUE,type = c(“windows”, “cairo”), antialias,symbolfamily=“default”)
png() png(filename = “Rplot%03d.png”,width = 480, height = 480, units = “px”, pointsize = 12,bg = “white”, res = NA, family = “”, restoreConsole = TRUE,type = c(“windows”, “cairo”, “cairo-png”), antialias,symbolfamily=“default”)
jpeg() jpeg(filename = “Rplot%03d.jpg”,width = 480, height = 480, units = “px”, pointsize = 12,quality = 75,bg = “white”, res = NA, family = “”, restoreConsole = TRUE,type = c(“windows”, “cairo”), antialias,symbolfamily=“default”)
tiff() tiff(filename=“Rplot%03d.tif”,width=480,height=480,units=“px”,pointsize=12,compression=c(“none”, “rle”, “lzw”, “jpeg”, “zip”, “lzw+p”, “zip+p”),bg = “white”, res = NA,family = “”,restoreConsole = TRUE,type = c(“windows”, “cairo”), antialias,symbolfamily=“default”)
pdf() pdf(file = if(onefile) “Rplots.pdf” else “Rplot%03d.pdf”,width, height, onefile, family, title, fonts, version,paper, encoding, bg, fg, pointsize, pagecentre, colormodel,useDingbats, useKerning, fillOddEven, compress)
win.metafile() win.metafile(filename = “”, width = 7, height = 7, pointsize = 12,family,restoreConsole = TRUE)
xfig() xfig(file = if(onefile) “Rplots.fig” else “Rplot%03d.fig”,onefile = FALSE, encoding = “none”,paper = “default”, horizontal = TRUE,width = 0, height = 0, family = “Helvetica”,pointsize = 12, bg = “transparent”, fg = “black”,pagecentre = TRUE, defaultfont = FALSE, textspecial = FALSE)
postscript() postscript(file = if(onefile) “Rplots.ps” else “Rplot%03d.ps”,onefile, family, title, fonts, encoding, bg, fg,width, height, horizontal, pointsize,paper, pagecentre, print.it, command,colormodel, useKerning, fillOddEven)

       除此之外,还可以通过dev.new()函数打开一个新的图形窗口,在窗口内点击【文件】→【另存为】,选择合适的文件格式保存图形内容。
R语言—图形基础


特别注明:本文属于学习笔记,不是以盈利为目的,整理的笔记中,若有构成侵权的地方,请联系作者删除,谢谢合作!