R繪圖系統(tǒng)3-計算機軟件及應用-IT計算機-專業(yè)資料_第1頁
R繪圖系統(tǒng)3-計算機軟件及應用-IT計算機-專業(yè)資料_第2頁
R繪圖系統(tǒng)3-計算機軟件及應用-IT計算機-專業(yè)資料_第3頁
R繪圖系統(tǒng)3-計算機軟件及應用-IT計算機-專業(yè)資料_第4頁
已閱讀5頁,還剩38頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領

文檔簡介

??,<??>曲3.1par(oma=rep(3,4),bg="gray80")plot(c(0,1),c(0,1),type="n",ann=FALSE,axes=FALSE)box[outer,col="gray")#setclippingtofigureregion

par(xpd=TRUE)deliberatelydrawastupidlylargerectanglerect(-1,-1,2,2,col="gray90")box("figure")setclippingbacktoplotregionpar(xpd=FALSE)deliberatelydrawastupidlylargerectanglerect(-1,-1,2,2,col="gray80")box("plot",lty="dashed")text(.5,.5,"PlotRegion")mtext("FigureRegion",side=3,line=2)for(iin1:4)mtext(paste("Outermargin",i),side=i,line=l,outer=TRUE)3.2par(oma=rep(3,4),mfrow=c(3,2),bg="gray80")for(iin1:6){if(i==3){omar<-par(mar=c(2,2,2,1))plot(c(0,1),c(0,1),type="n",ann=FALSE,axes=FALSE)par(xpd=TRUE)rect(-1,-1,2,2,col="gray90")box("figure")par(xpd=FALSE)rect(-1,-1,2,2,col="gray80")box("plot",lty="dashed")text(.5,.5,"CurrentPlotRegion",cex=l.5)mtext("CurrentFigureRegion",side=3)par(omar)}else{omar<-par(mar=rep(0,4))plot(c(0,1),c(0,1),type="n",ann=FALSE,axes=FALSE)par(xpd=TRUE)rect(-1,-1,2,2,col="gray90")box("figure")text(.5,.5,paste("Figure",i),cex=l.5)par(omar))}box("outer",col="gray")for(iin1:4)mtext(paste("Outermargin",i),side=i,line=l,outer=TRUE)par(mar=c(3,6,2,2),xaxs=i,yaxs=i,xpd=FALSE,las=l)plot(c(0,1),c(0,1),type="n",ann=FALSE,axes=FALSE)box("figure")rect(0,0,1,1,col="lightgray",border="gray")axis(1,at=c(0,1),c("",""))mtext("Minx-value",side=l,adj=0,line=l)mtext("Maxx-value",side=l,adj=l,line=l)axis(2,at=c(0,1),c("〃,""))mtext("Miny-value",side=2,at=0,adj=l,line=l)mtext("Maxy-value",side=2,at=l,adj=l,line=l)lines(c(.6,.6,0),c(0,.6,.6),lty="dashed")text(.6,.6,expression(paste("Thelocation",group("(",list(x[i],y[i]),”)"))),pos=3)points(.6,.6,pch=16)axis(1,at=.6,"")mtext(expression(x[i]),side=l,at=.6,line=.7)axis(2,at=.6,"")mtext(expression(y[i]),side=2,at=.6,line=.7)pushViewport(viewport(layout=grid.layout(3,1,heights=unit(rep(l,3),c("null","cm","null")))))pushViewport(viewport(layout,pos.row=l))grid,rect()pushViewport(plotviewport(c(5,5,3,2),xscale=c(0,11)))grid,rect(gp=gpar(col="gray"))grid,text("CurrentPlot",gp=gpar(col="gray"))grid,rect(0,unit(-5,"lines"),1,unit(5,"lines"),just=c("left","bottom"),gp=gpar(col="gray",fill="lightgray"))grid,text("Figure\nMargin\nl",y=unit(-2.5,"lines"))grid,lines(c(0,1),c(0,0))grid,segments(c(0,1),c(0,0),c(0,1),unit(c(.5,.5),"lines"))grid,text(c("xmin","xmax"),c(0,1),unit(c(1,1),"lines"))grid,lines(c(0,0),unit(c(-1,-4),"lines"))grid,segments(c(0,0),unit(c(-1,-4),"lines"),unit(c(-.5,-.5),"lines"),unit(c(-1,-4),grid,text(c(/z0lines","3lines"),unit(c(-1,-1),"lines"),unit(c(-1,-4),"lines"),just=c("right","bottom"))popViewport(2)pushViewport(viewport(layout,pos.row=3))grid,rect()pushViewport(plotviewport(c(5,5,3,2),yscale=c(0,11)))grid,rect(gp=gpar(col="gray"))grid.text("CurrentPlot",gp=gpar(col="gray"))grid,rect(unit(-5,"lines"),0,unit(5,"lines"),1,just=c("left","bottom"),gp=gpar(col="gray",fill="lightgray"))grid,text("Figure\nMargin\n2",x=unit(-2.5,"lines"))grid,lines(c(0,0),c(0,1))grid,segments(c(0,0),c(0,1),unit(c(.5,.5),"lines"),c(0,1))grid,text(c("ymin","ymax"),unit(c(1,1),"lines"),c(0,1),just="left")grid,lines(unit(c(0,-3),"lines"),c(0,0))grid,segments(unit(c(0,-3),"lines"),c(0,0),unit(c(0,-3),"lines"),unit(c(-.5,-.5),grid,text(c(/z0lines","3lines"),unit(c(0,-3),"lines"),unit(c(-1,-1),"lines"),rot=90,just=c("right","bottom"))popViewport(2)popViewport()3.5pushViewport(viewport(layout=grid.layout(3,1,heights=unit(c(1,1,1),c("null","cm","null")))))#FirstpagepushViewport(viewport(layout,pos.row=3,layout=grid.layout(3,4,widths=unit(c(2.5,1,1,1),c("cm","null","null","cm")),heights=unit(c(1,1,2.5),c("cm","null","cm")))))grid,rect(gp=gpar(col="black"))for(iin2){for(jin2:3){pushViewport(viewport(layout,pos.col=j,layout,pos.row=i))grid,rect(gp=gpar(col="gray"))pushViewport(plotviewport(c(2,2,1,1),xscale=c(0,11),gp=gpar(col="gray")))grid,rect(gp=gpar(col="gray"))grid,text(paste(//Plot,,(j-1))popViewport()popViewport()}}pushViewport(viewport(layout,pos.row=2,layout,pos.col=l))grid,rect(gp=gpar(col="gray”,fil_L=lightgray"))grid,text(“0uter\nMargin\n2")grid,lines(c(1,1),c(0,1))grid,segments(c(1,1),c(0,1),unit(1,"npc")+unit(c(.5,.5),"lines"),c(0,1))grid,text(0:1,unit(1,"npc")+unit(c(1,1),"lines"),c(0,1))grid,lines(unit(1,"npc")-unit(c(0,3),"lines"),c(0,0))grid,segments(unit(1,"npc")-unit(c(0,3),"lines"),c(0,0),unit(1,"npc")-unit(c(0,3),"lines"),grid,text(c(/z0lines","3lines"),unit(1,"npc")-unit(c(0,3),"lines"),unit(c(-1,-1),"lines"),rot=90,just=c("right","bottom"))popViewport(2)SecondpagepushViewport(viewport(layout,pos.row=l,layout=grid.layout(3,4,widths=unit(c(2.5,1,1,1),c("cm","null","null","cm")),heights=unit(c(1,1,2.5),c("cm","null","cm")))))grid,rect(gp=gpar(col="black"))for(iin2){for(jin2:3){pushViewport(viewport(layout,pos.col=j,layout,pos.row=i))grid,rect(gp=gpar(col="gray"))pushViewport(plotviewport(c(2,2,1,1),xscale=c(0,11),gp=gpar(col="gray")))grid,rect(gp=gpar(col="gray"))grid,text(paste("Plot",j-1))popViewport()popViewport()pushviewport(viewport(layout,pos.row=3,layout,pos.col=2:3))grid,rect(gp=gpar(col="gray”,fi丄1=lightgray"))grid.text("OuterMargin1")grid,lines(c(0,1),c(1,1))grid,segments(c(0,1),unit(c(1,1),"npc"),c(0,1),unit(c(1,1),"npc")+unit(.5,"lines"))grid,rect(c(0,1),unit(c(1, 1), "npc")+unit(1,"lines"),unit(c(1, 1), "strwidth",list("0","1")),unit(c(1, 1), "strheight",list("0","1")),gp=gpar(col=NULL,fill="white"))grid,text(c(0,1),c(0,1),unit(c(1,1),"npc")+unit(1,"lines"))grid,lines(c(0,0),unit(l,"npc")-unit(c(1,4),"lines"))grid,segments(c(0,0),unit(1,"npc")-unit(c(1,4),"lines"),unit(1,"npc")-unit(c(1,4),“l(fā)ines))grid,text(c("0lines","3lines"),unit(c(-1,-1),"lines"),unit(1,"npc")-unit(c(1,4),"lines"),just=c("right","bottom"))popViewport(2)popViewport()par(mar=rep(0,4),cex=0.7)plot,new()plot,window(c(0.05,0.95),0:1)familyく-c(sans,sent,mono)face<-1:4for(iin1:4)for(jin1:3){par(family=family[j],lheight=l.5)text(seq(.15,.85,length=4)[i],seq(.25,.75,length=3)[j],

paste("family=\,family[j],ヘ’\nfont=,face[i],font=face[i])}segments(.02,c(.125,.,375,.625,.875),.98,c(.125,.,375,.625,.875),col=gray")segments(.02,c(.125,.,375,.625,.875)-.01,.02,c(.125,.,375,.625,.875)+.01,col="gray")segments(.98,c(.125,.,375,.625,.875)-.01,.98,c(.125,.,375,.625,.875)+.01,col="gray")rect(c(.27,.5,.73).01,.1,c(.27,.5,.73)+.01,.9,col="white”,border=NA)par(mar=rep(0,4),xaxs=i,yaxs=i,cex=0.8)plot,new()par(new=TRUE)grid.rect(gp=gpar(col="gray"))nrow<-4xadj<-c(l,0.5,NA,0)yadj<-c(l,0.5,NA,0)size<-unit(3,"mm")for(iin1:nrow){for(jin1:ncol){x<-i/(nrow+1)y<-j/(ncol+1)xu<-unit(x,"npc")yu<-unit(y,"npc")grid,segments(unit.c(xu-size,xu),unit,c(yu,yu-size),unit,c(xu+size,xu),unit,c(yu,yu+size),gp=gpar(col="gray"))text(x,y,paste("c(",xadj[j],",",yadj[i],")",sep=""),adj=c(xadj[j],yadj[i]))3.8ncol<-6nrow<-1grid,rect(gp=gpar(col="gray"))for(iin1:nrow){for(jin1:ncol){x<-unit(j/(ncol+1),“npc")y<-unit(i/(nrow+1),“npc")pch<-(i-l)*ncol+j-1grid,points(x+unit(3,"mm"),y,pch=pch,gp=gpar(fill="gray"))grid,text(pch,x-unit(3,"mm"),y,gp=gpar(col=gray"))3.9x<--5:5y<--x"2+25plottype<-function(type){par(mar=c(1,0,1,0),pty=s")plot,new()plot,window(c(-6,6),c(-2,27))box(col="gray")points(x,y,type=type)mtext(paste(〃type=\"",type,〃sep="〃))par(mfrow=c(3,2))plottype(,zp)plottype("1")plottype("b")plottype(“〇”)plottype("h")plottype("s")3.10axisfun<-function(mgp=c(3,1,0),xaxs="r",tcl=-.5,mgpcol="black",xaxscol="black",tclcol="black"){par(mar=c(5,1,0,1),mgp=mgp,xaxs=xaxs,tcl=tcl,pty="s")plot,new()box(col二〃gray")text(.5,.75,paste("mgp=c(",paste(mgp,collapse=","),")",sep=),col=mgpcol)text(.5,.5,paste("xaxs=\,xaxs,“ヽ,sep=),col=xaxscol)text(.5,.25,paste("tcl=",tel,sep=),col=tclcol)axis(1,at=c(0,.5,1))title(xlab=,/X-axisLabel")par(mfrow=c(2,2))axisfun()axisfun(mgp=c(2,0.3,0),tcl=0.2,xaxscol="gray")axisfun(xaxs="i",mgpcol="gray",tclcol="gray")3.111ibrary(gridBase)par(oma=rep(3,4))vps<-baseViewports()#AnnotationhelperfunctionannWidth<-function(x,y,lab,above=TRUE,horiz=TRUE){grid,arrows(x=x,y=y,ends="both”,angle=10,type="closed”,length=unit(3,"mm"),gp=gpar(fill="black"))nl<-length(lab)if(nl>1){y<-y+unit(c(-0.5,0.5),"lines")if(horiz){vjust<-1:0hjust<-0.5rot<-0}else{hjust<-1:0vjust<-0.5rot<-90}}else{hjust<-0.5rot<-0if(above){y<-y+unit(0.5,“l(fā)ines")vjust<-0}else{y<-y-unit(0.5,“l(fā)ines")vjust<-1}}grid,text(lab,x=0.5*sum(x),y=y,hjust=hjust,vjust=vjust,rot=rot,gp=gpar(fontfamily="mono",cex=l))}Annotatewholepagegrid.rect(gp=gpar(col="gray",fill="gray80"))annWidth(0:1,unit(1,"npc")-unit(1.5,"lines"),"din[l]")grid,lines(x=0.5)annWidth(unit(c(0,3),"lines"),unit(0.7,"npc"),c("omi[2]","oma⑵"))annWidth(unit(1,"npc")-unit(c(0,3),“l(fā)ines"),unit(0.7,"npc"),c("omi[4]","oma[4]"))annWidth(unit(c(0,3),"lines"),unit(0.3,"npc"),“omd[1]”,above=FALSE)annWidth(unit.c(unit(0,"npc"),unit(1,"npc")-unit(3,"lines")),unit(2,"lines"),"omd[2]",above=FALSE)Annotatefigureregionpushviewport(do.call("vpStack",vps[1:2]))grid,rect(gp=gpar(fi1l="gray90"))annWidth(0:1,unit(1,"npc")-unit(1.5,"lines"),"fin[l]")annWidth(unit(c(0,4.1),"lines"),unit(0.6,"npc"),c("mai[2]",“mar⑵"))annWidth(unit(1,"npc")-unit(c(0,2.1),"lines"),unit(0.6,"npc"),c("mai[4]","mar[4]"),horiz=FALSE)annWidth(unit(c(0,4.1),"lines"),unit(0.4,"npc"),"pit[1]",above=FALSE)annWidth(unit,c(unit(0,"npc"),unit(1,"npc")-unit(2.1,"lines")),unit(4,"lines"),"pit[2]",above=FALSE)Annotateplotregionpushviewport(vps[[3]])grid,rect(gp=gpar(lty="dashed",fill="gray80"))annWidth(0:1,unit(1,"npc")-unit(1.5,“l(fā)ines"),pin[l]")popViewport(3)3.12grid.Ishow<-function(i,j,lab,order,nrow,ncol,heights,respect){pushViewport(viewport(layout,pos.col=j,layout,pos.row=i))pushviewport(viewport(width=unit(1,"npc")-unit(2,"lines"),height=unit(1,"npc")-unit(3,"lines"),y=unit(3,"lines"),just="bottom",layout=grid.layout(nrow,ncol,heights=heights,respect=respect)))grid,rect(gp=gpar(col="gray"))for(iin1:nrow){for(jin1:ncol){pushViewport(viewport(layout,pos.row=i,layout,pos.col=j))grid,rect()grid,text(order[i,j])popViewport()popViewport()grid,text(lab,y=unit(2,"lines"))popViewport()pushviewport(viewport(layout=grid.layout(2,2)))grid.lshow(l,1,"(a)",cbind(c(1,3,5),c(2,4,6)),3,2,rep(1,3),FALSE)grid.lshow(l,2,"(b)",cbind(c(6,4,2),c(5,3,1)),3,2,rep(1,3),FALSE)grid.lshow(2,1,"(c)",matrix(c(l,2),ncol=l),2,1,c(2,1),FALSE)grid.lshow(2,2,"(d)",matrix(c(l,2),ncol=l),2,1,c(2,1),TRUE)popViewport()3.13grid.Ishow<-function(i,j,lab,Iocs,nrow,ncol,heights,respect){pushviewport(viewport(layout,pos.col=j,layout,pos.row=i))pushViewport(viewport(width=unit(1,"npc")-unit(2,“l(fā)ines"),height=unit(1,"npc")-unit(3,"lines"),y=unit(3,"lines"),just="bottom",layout=grid.layout(nrow,ncol,heights=heights,respect=respect)))grid,rect(gp=gpar(col="gray"))for(iinIocs){pushViewport(viewport(layout,pos.row=i$rows,layout,pos.col=i$cols))grid,rect()grid,text(i$lab)popViewport()}popViewport()grid,text(lab,y=unit(2,"lines"))popViewport()}pushViewport(viewport(layout=grid.layout(2,2)))grid.lshow(l,1,"(a)",list("null")),"null")),"null")),"null")),list(rows=l,list(rows=3,3,1,unit(c(2,0.5,TRUE)grid.1show(1,2,list(list(rows=l,list(rows=3,list(rows=l,3,2,unit(c(2,0.5,TRUE)grid.Ishow(2,1,list(list(rows=l,list(rows=3,list(rows=l,cols=l,lab=l),cols=l,lab=2)),1),c("null","cm"(b)”,cols=l,lab=l),cols=l:2,lab=2),cols=2,lab=3)),1),c("null","cm"(c)",cols=l,lab=l),cols=l:2,lab=2),cols=2,lab=3)),3,2,"null")),unit(c(2,0.5,1),c("null","cm"null")),cbind(c(0,0,1),c(0,0,0)))popViewport()3.14par(mfrow=c(1,2),mar=c(1,1,2,1))par(cex=O.7)x<-1:10y<-matrix(sort(rnorm(30)),ncol=3)plot(x,y[,1],ylim=range(y),ann=FALSE,axes=FALSE,type="]”,col=,,gray,/)box(col="gray")points(x,y[,1])lines(x,y[,2],col="gray")points(x,y[,2],pch=2)lines(x,y[,3],col="gray")points(x,y[,3],pch=3)mtext(''points()&lines()",side=3,line=0.5)x<-1:5y<-xplot(x,y,ann=FALSE,axes=FALSE,col="gray”,pch=16)box(col="gray")text(x[-3],y[-3],c("righピ',"top","bottom","left"),pos=c(4,3,1,2))text(3,3,"overlay")mtext("text()",side=3,line=0.5)3.15t<-seq(60,360,30)x<-cos(t/18〇?pi)*t/360y<-sin(t/180*pi)*t/360library(pixmap)source(system,file("extra","as.raster.R",package="RGraphics"))rlogo<-read,pnm(system,file("pictures/logo.pgm",package="pixmap")[1])par(mfrow=c(1,2),mar=c(1,1,2,1))par(cex=O.7)t<-seq(60,360,30)x<-cos(t/180*pi)*t/360y<-sin(t/180*pi)*t/360par(mfrow=c(3,3),mar=rep(l,4),pty=s)plot(x,y,pch=16,col="gray",xlim=c(-.6,1.1),ylim=c(-l.1,.6),axes=FALSE,ann=FALSE)box(col="gray")mtext("lines()”,side=3,line=.6,cex=.7,family="mono")lines(x,y)plot(x,y,pch=16,col="gray",xlim=c(-.6,1.1),ylim=c(-l.1,.6),axes=FALSE,ann=FALSE)box(col="gray")mtext("segments()”,side=3,line=.6,cex=.7,family="mono")segments(0,0,x,y)plot(x,y,pch=16,col="gray",xlim=c(-.6,1.1),ylim=c(-l.1,.6),axes=FALSE,ann=FALSE)box(col="gray")mtext("arrows()",side=3,line=.6,cex=.7,family="mono")arrows(0,0,x[-l],y[-l],length=.1)plot(x,y,pch=16,col="gray",xlim=c(-.6,1.1),ylim=c(-l.1,.6),axes=FALSE,ann=FALSE)box(col="gray")mtext("xspline()",side=3,line=.6,cex=.7,family="mono")xspline(x,y,shape=l)plot(x,y,pch=16,col="gray",xlim=c(-.6,1.1),ylim=c(-l.1,.6),axes=FALSE,ann=FALSE)box(col="gray")mtext("rect()",side=3,line=.6,cex=.7,family="mono")rect(min(x),min(y),max(x),max(y),col="gray")plot(x,y,pch=16,col=//gray/,,xlim=c(-.6,1.1),ylim=c(-l.1,.6),axes=FALSE,ann=FALSE)box(col="gray")mtext("polygon。",side=3,line=.6,cex=.7,family="mono")polygon(x,y,col="gray")plot(x,y,pch=16,col="gray",xlim=c(-.6,1.1),ylim=c(-l.1,.6),axes=FALSE,ann=FALSE)box(col="gray")mtext("polypath()",side=3,line=.6,cex=.7,family="mono")polypath(c(x,NA,.5*x),c(y,NA,.5*y),col="gray",rule="evenodd")plot(x,y,pch=16,col="gray",xlim=c(-.6,1.1),ylim=c(-l.1,.6),axes=FALSE,ann=FALSE)box(col="gray")mtext("xspline()",side=3,line=.6,cex=.7,family="mono")xspline(x,y,shape=l,open=FALSE,col="gray")plot(x,y,pch=16,col=//gray/,,xlim=c(-.6,1.1),ylim=c(-l.1,.6),axes=FALSE,ann=FALSE)box(col="gray")mtext("rasterimage()”,side=3,line=.6,cex=.7,family="mono")rasterimage(rlogo,x-.07,y-.07,x+.07,y+.07,interpolate=FALSE)3.16par(mfrow=c(1,2),mar=c(1,1,2,1),pty="s")par(cex=0.7)x<-runif(20,1,10)y<-x+rnorm(20)plot(x,y,ann=FALSE,axes=FALSE,col=gray",pch=16)box(col="gray")Imfit<-lm(y?x)abline(lmfit)arrows(5,8,7,predict(Imfit,data,frame(x=7)),length=0.1)text(5,8,"Lineofbestfit",pos=2)mtext("abline()&arrows()",side=3,line=0.5)y<-rnorm(50)hist(y,main=,xlab="",ylab="",axes=FALSE,border="gray",col="lightgray")box(col="gray")rug(y,ticksize=O.02)mtext("rug()",side=3,line=0.5)3.17angle<-seq(0,2*pi,length=13)[-13]x<-0.15*cos(angle)y<-0.5+0.3*sin(angle)par(mar=rep(0,4))plot,new()box("outer",col="gray")polygon(0.25+x,y,col="gray")text(0.75+x[c(1,5,9)],y[c(1,5,9)],"NA",col="gray")x[c(l,5,9)]<-NAy[c(l,5,9)]<-NApolygon(0.75+x,y,col="gray")3.18par(mar=c(2,1,1,1))yl<-rnorm(lOO)y2<-rnorm(lOO)par(mfrow=c(2,1),xpd=NA)plot(yl,type="l",axes=FALSE,xlab-,ylab-,main-)box(col="gray")mtext("Leftendofmargin",adj=O,side=3)lines(x=c(20,20,40,40),y=c(-7,max(y1),max(yl),-7),lwd=3,col="gray")plot(y2,type="l",axes=FALSE,xlab-,yiab-,main-)box(col="gray")mtext("Rightendofmargin",adj=l,side=3)mtext("Labelbelowx=30",at=30,side=l)lines(x=c(20,20,40,40),y=c(7,min(y2),min(y2),7),lwd=3,col="gray")3.19par(mfrow=c(2,1),mar=c(5,3,2,1),cex=0.5,pty="s")with(iris,plot(Sepal.Length,Sepal.Width,pch=as.numeric(Species),cex=l.2))legend(6.1,4.4,c("setosa","versicolor","virginica"),cex=l.5,pch=l:3)barplot(VADeaths[1:2,],angle=c(45,135),density=20,co1="gray",names=c("RM","RF","UM","UF"))legend(0.4,38,c("55-59”,"50-54"),cex=l.5,angle二c(135,45),density-20,fill="gray")3.20par(cex=0.8)x<-1:2y<-runif(2,0,100)par(mar=c(4,4,2,4))plot(x,y,type="n",xlim=c(0.5,2.5),ylim=c(T0,110),axes=FALSE,ann=FALSE)axis(2,at-seq(0,100,20))mtext("Temperature(Centigrade)",side=2,line=3)axis(1,at-1:2,labels=c("Treatment1",'Treatment2"))axis(4,at=seq(0,100,20),labels=seq(0,100,20)*9/5+32)mtext("Temperature(Fahrenheit)",side=4,line=3)box()segments(x,0,x,100,Iwd=20)segments(x,0,x,100,lwd=16,col="white")segments(x,0,x,y,lwd=16,col="gray")3.21par(mar=rep(l,4))plot(0:1,0:1,type="n",axes=FALSE,ann=FALSE)usr<-par("usr")pin<-par("pin")xcm<-diff(usr[1:2])/(pin[l]*2.54)ycm<-diff(usr[3:4])/(pin[2]*2.54)par(xpd=NA)rect(0+0.2*xcm.〇ー〇.2*ycm,1+0.2*xcm,1-0.2*ycm,col="gray",border=NA)rect(0,0,1,1,col="white")segments(seq(1,8,0.1)*xcm,0,seq(1,8,0.l)*xcm,c(rep(c(0.5,rep(0.25,4),0.35,rep(0.25,4)),7),0.5)*ycm)text(1:8*xcm,0.6*ycm,0:7,adj=c(0.5,0))text(8.2*xcm,0.6*ycm,"cm”,adj=c(0,0))3.22layout(matrix(1:2,ncol=l),heights=l:2/6.5)par(cex=0.7)drunkenness<-ts(c(3875,4846,5128,5773,7327,6688,5582,3473,3186,rep(NA,51)),

start=1912,end=1971)#Havetocopy-and-pastetoshrinkthemtexttext(arggh!)par(mar=c(5,6,2,4))plot(drunkenness,lwd=3,col="gray",ann=FALSE,las=2)mtext("Drunkenness\nRelatedArrests",side=2,line=3.5,cex=0.7)par(new=TRUE)plot(nhtemp,ann=FALSE,axes=FALSE)mtext(^Temperature(F)”,side=4,line=3,cex=O.7)title(,zUsingpar(new=TRUE)orpar(usr=…)”)axis(4)par(mar=c(5,4,4,2))with(trees,(plot(Height,Volume,pch=3,xlab="Height(ft)",ylab=expression(paste('Volume,(ft3))))symbols(Height,Volume,circles=Girth/12,fg="gray",inches=FALSE,add=TRUE)})mtext("symbols(...,add=TRUE)",font=2,side=3,line=l)3.23xx<-c(1:50)yy<-rnorm(50)n<-50hline<-0xx<-c(1:50)yy<-rnorm(50)n<-50hline<-0par(mfrow=c(2,2),mar=c(3,3,1,1))plot(yyxx,type="n",axes=FALSE,ann=FALSE)polygon(c(xx[1],xx,xx[n]),c(min(yy),yy,min(yy)),col="gray”,border=NA)box(col="gray")plot(yyxx,type="n",axes=FALSE,ann=FALSE)polygon(c(xx[1],xx,xx[n]),c(min(yy),yy,min(yy)),col="gray”,border=NA)usr<-par("usr")rect(usr[l],usr[3],usr[2],hline,col=white,border=NA)box(col="gray")plot(yy?xx,type="n",axes=FALSE,ann=FALSE)polygon(c(xx[1],xx,xx[n]),c(min(yy),yy,min(yy)),col="gray”,border=NA)usr<-par("usr")rect(usr[l],usr[3],usr[2],hline,col=white,border=NA)lines(xx,yy)box(col="gray")plot(yyxx,type="n",axes=FALSE,ann=FALSE)polygon(c(xx[1],xx,xx[n]),c(min(yy),yy,min(yy)),col="gray”,border=NA)usr<-par("usr")rect(usr[l],usr[3],usr[2],hline,col="whit

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論