现在项目需要R语言做几个线性拟合,画一些点图,突然需要画误差线,网上找了下,可以用代码实现..效果如下 xx1<-c(xxxxxx,xxxx,xxxxx) yy1<-c(xxxxxx,xxxx,xxxxx) std1<-c(xxxxxx,xxxx,xxxxx) std2<-c(xxxxxx,xxxx,xxxxx) plot_stdy <- function(x, y, sd, len = 1, col = "black") { len <- len
1.在linux中安装好R 2.准备好画曼哈顿图的R脚本即manhattan.r,manhattan.r内容如下: #!/usr/bin/Rscript #example : Rscript plot_manhatom.r XXX.assoc XXX.pdf argv <- commandArgs() #define the function to plot the manhatton and quantitle-quantitle plot plot_manhatton<-function(
R语言基础绘图系统 基础图形--散点图.盒形图 plot是一个泛型函数(generic method),对于不同的数据绘制不同的图形. par函数的大部分参数在plot中通用. 1.散点图 plot绘制散点图类型,type有6种,即p, b, l, s, o, n. type=c('p','b','l','s','o','n') par(mfrow=c(2,3)) for(i in 1:6){ plot(1:10,type = type[i], main = paste('type is: ',