R语言画图布局摆放(layout)】的更多相关文章

require(ggplot2) require(Cairo) require(grid) p = ggplot(iris,aes(x = Species,y = Sepal.Length,colour = Species)) p+geom_point() a = p+geom_point() b = qplot(Sepal.Length,Petal.Length,data=iris,geom="point",colour = Species) c = qplot(Species,Se…
R 语言画图的基本参数 点 点的种类 点的种类参数为 pch,每一种符号对应一个数字编号 # 点有25种,为了展示25种点 x = 1:25 y = 1:25 x ## [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ## [24] 24 25 plot(x, x, pch = x) # 在图上随意添加点 lines(10, 15, type = "b", pch = 5) # type的含义 plot(x…
R语言画图教程之盒形图 我们之前有分享过一系列的R语言画图代码(PCA图.Pathway图.火山图.RDA图.热图),今天再来补充一个盒形图(箱形图)的代码. 以下代码只是示例,不能直接搬来用哦,注意看注释. --------------代码开始了------------- setwd("E:/") #改变工作目录 data=read.table("data.txt",header=T) #读取数据,"header=T"第一行为表头 mycolo…
本文以1950年到2010年期间我国的火灾统计数据为例,数据如下所示: (0)加载数据 data<-read.csv("E:\\MyDocument\\p\\Data\\1950~2010火灾情况.csv") x=t(data[1]) y=t(data[2]) z=t(data[3]) w=t(data[4]) maxy=max(y) maxz=max(z) maxw=max(w) (1)将火灾数.直接损失.死伤人数,分别按年份作图 plot(x,y,type="o&q…
绘制气泡图主要使用函数symbols(x,y,circle=r).当中x.y是坐标轴,r是每一个点的半径. x<-rnorm(10) y<-rnorm(10) r<-abs(rnorm(10)) symbols(x,y,circle = r, bg=rainbow(10)) 此外,我们还能够给每一个气泡加上文字. attach(mtcars) r<-sqrt(disp/pi) symbols(wt,mpg,circle=r, inches=0.3, bg="lightbl…
转http://www.cnblogs.com/jiangmiaomiao/p/6991632.html 0 引言 R支持4种图形类型: base graphics, grid graphics, lattice graphics,  ggplot2.其中,Base graphics是R的默认图形系统. 1  基本图形函数plot() plot()命令中的type参数用于明确图形如何绘制,具体type值使用如下: "p" for "points" "l&q…
dose <- c(, , , ,) drugA <- c(, , , , ) drugB <- c(, , , , ) # 数据准备 opar <- par(no.readonly=T) # 保存画图环境 par(lwd=, cex=) # 设置画图环境 plot(dose, drugA, type=, lty=, col=,), main="Drug A vs. Drug B", xlab="Drug Dosage", ylab=&quo…
Graphical Parameters You can customize many features of your graphs (fonts, colors, axes, titles) through graphic options. One way is to specify these options in through the par( ) function. If you set parameter values here, the changes will be in ef…
笔者寄语:不论画啥,你先plot准没错. plot 二维坐标绘图 dotchart 点图 barplot 条形图 hist 直方图 pie 饼图 points 添加点 lines 添加线 text 添加文字 title 添加标题 boxplot 箱线图 1.plot函数 ##画图 plot(x~y,xlab="",ylab="",main="",xlim=c(0,45),ylim=c(0,45),pch=18,col=2,cex=5) #xlab…
在R语言中,par 函数可以设置图形边距,其中oma 参数设置outer margin, mar 参数设置margin, 这些边距有什么不同呢,通过box函数可以直观的看到 box 默认在当前图形绘制边框,第一个参数which = "plot", 所以在当前图形上绘制边框 which 的值除了plot 之外,还可以选择 figure, inner, outer 接下来分别用不同的值测试一下,为了区分,为不同的边框设置不同的颜色和类型,代码如下: attach(mtcars) plot(…