您好,欢迎访问三七文档
6.1pushViewport(viewport(layout=grid.layout(2,2),gp=gpar(cex=0.6,fill=NA)))pushViewport(viewport(layout.pos.col=1,layout.pos.row=1))pushViewport(plotViewport(c(5,4,2,2)))pushViewport(dataViewport(pressure$temperature,pressure$pressure,name=plotRegion))grid.points(pressure$temperature,pressure$pressure,gp=gpar(cex=0.5))grid.rect()grid.xaxis()grid.yaxis()grid.text(temperature,y=unit(-3,line))grid.text(pressure,x=unit(-3,line),rot=90)popViewport(3)pushViewport(viewport(layout.pos.col=2,layout.pos.row=1))pushViewport(plotViewport(c(5,4,2,2)))pushViewport(dataViewport(pressure$temperature,pressure$pressure,name=plotRegion))grid.points(pressure$temperature,pressure$pressure,pch=2,gp=gpar(cex=0.5))grid.rect()grid.xaxis()grid.yaxis()grid.text(temperature,y=unit(-3,line))grid.text(pressure,x=unit(-3,line),rot=90)popViewport(3)pushViewport(viewport(layout.pos.col=2,layout.pos.row=2))pushViewport(plotViewport(c(5,4,2,2)))pushViewport(dataViewport(pressure$temperature,pressure$pressure,name=plotRegion))grid.points(pressure$temperature,pressure$pressure,pch=2,gp=gpar(cex=0.5))grid.rect()grid.xaxis()grid.yaxis()grid.text(temperature,y=unit(-3,line))grid.text(pressure,x=unit(-3,line),rot=90)upViewport(2)grid.rect(gp=gpar(lty=dashed))downViewport(plotRegion)grid.text(Pressure(mmHg)\nversus\nTemperature(Celsius),x=unit(150,native),y=unit(600,native))6.2grid.rect(gp=gpar(col=gray))grid.circle(x=seq(0.1,0.9,length=100),y=0.5+0.4*sin(seq(0,2*pi,length=100)),r=abs(0.1*cos(seq(0,2*pi,length=100))))6.3grid.rect(gp=gpar(col=gray))grid.circle(c(.1,.3,.4,.6,.7,.9),c(.25,.75),r=unit(1,mm),gp=gpar(col=NA,fill=gray))grid.curve(x1=.1,y1=.25,x2=.3,y2=.75)grid.curve(x1=.4,y1=.25,x2=.6,y2=.75,square=FALSE,ncp=8,curvature=.5)grid.curve(x1=.7,y1=.25,x2=.9,y2=.75,square=FALSE,angle=45,shape=-1)6.4grid.rect(gp=gpar(col=gray))angle-seq(0,2*pi,length=50)grid.lines(x=seq(0.1,0.5,length=50),y=0.5+0.3*sin(angle),arrow=arrow())grid.segments(6:8/10,0.2,7:9/10,0.8,arrow=arrow(angle=15,type=closed))6.5grid.rect(gp=gpar(col=gray))angle-seq(0,2*pi,length=10)[-10]grid.polygon(x=0.25+0.15*cos(angle),y=0.5+0.3*sin(angle),gp=gpar(fill=gray))grid.polygon(x=0.75+0.15*cos(angle),y=0.5+0.3*sin(angle),id=rep(1:3,each=3),gp=gpar(fill=gray))6.6grid.rect(gp=gpar(col=gray))angle-seq(0,2*pi,length=10)[-10]grid.path(x=0.25+0.15*cos(angle),y=0.5+0.3*sin(angle),gp=gpar(fill=gray))grid.path(x=c(0.75+0.15*cos(angle),.7,.7,.8,.8),y=c(0.5+0.3*sin(angle),.4,.6,.6,.4),id=rep(1:2,c(9,4)),gp=gpar(fill=gray))6.7grid.rect(gp=gpar(col=gray))pushViewport(viewport(gp=gpar(col=gray)))grid.text(verysnug,0.4,unit(1,in),just=c(left,bottom))grid.lines(x=0.4,y=unit(0:1,in),arrow=arrow(ends=both,length=unit(1,mm)))grid.text(1inch,unit(0.4,npc)+unit(0.5,line),unit(0.5,in),rot=90)grid.lines(x=c(0,0.4),y=unit(1,in),arrow=arrow(ends=both,length=unit(1,mm)))grid.text(unit(0.4,npc),0.2,unit(1,in)+unit(0.5,line))popViewport()pushViewport(viewport(gp=gpar(fill=NA)))grid.rect(x=unit(0.4,npc),y=unit(1,in),width=stringWidth(verysnug),height=unit(1,line),just=c(left,bottom))6.8grid.rect(gp=gpar(col=gray))pushViewport(viewport(gp=gpar(fontsize=10)))grid.rect(x=0.33,height=0.7,width=0.2,gp=gpar(fill=black))grid.rect(x=0.66,height=0.7,width=0.2)grid.text(grid.rect(),x=0.66,rot=90)grid.text(grid.rect(gp=gpar(fill=\black\)),x=0.33,rot=90,gp=gpar(fontsize=8,col=white))popViewport()6.9grid.rect(gp=gpar(col=gray))levels-round(seq(90,10,length=25))grays-paste(gray,c(levels,rev(levels)),sep=)grid.circle(x=seq(0.1,0.9,length=100),y=0.5+0.4*sin(seq(0,2*pi,length=100)),r=abs(0.1*cos(seq(0,2*pi,length=100))),gp=gpar(col=grays))6.10grid.rect(gp=gpar(col=gray))angle-seq(0,2*pi,length=11)[-11]grid.polygon(x=0.25+0.15*cos(angle),y=0.5+0.3*sin(angle),id=rep(1:2,c(7,3)),gp=gpar(fill=c(gray,white)))angle[4]-NAgrid.polygon(x=0.75+0.15*cos(angle),y=0.5+0.3*sin(angle),id=rep(1:2,c(7,3)),gp=gpar(fill=c(gray,white)))angle-seq(0,2*pi,length=11)[4]grid.text(NA,x=0.75+0.15*cos(angle),y=0.5+0.3*sin(angle),gp=gpar(col=gray))6.11vp1-viewport(x=unit(0.4,npc),y=unit(1,cm),width=stringWidth(veryverysnugindeed),height=unit(6,line),just=c(left,bottom))grid.show.viewport(scale.col=gray,border.fill=white,vp.col=black,vp.fill=gray,vp1)grid.rect(gp=gpar(col=white,fill=NA,lwd=3))pushViewport(viewport(.5,.5,.8,.8))pushViewport(vp1)grid.rect(gp=gpar(fill=NA))grid.text(veryverysnugindeed,gp=gpar(col=white))popViewport(2)6.12grid.rect(gp=gpar(col=gray))grid.text(top-leftcorner,x=unit(1,mm),y=unit(1,npc)-unit(1,mm),just=c(left,top))pushViewport(viewport(width=0.8,height=0.5,angle=10,name=vp1))grid.rect()grid.text(top-leftcorner,x=unit(1,mm),y=unit(1,npc)-unit(1,mm),just=c(left,top))6.13grid.rect(gp=gpar(col=gray))grid.text(top-leftcorner,x=unit(1,mm),y=unit(1,npc)-unit(1,mm),just=c(left,top))pushViewport(viewport(width=0.8,height=0.5,angle=10,name=vp1))grid.rect()grid.text(top-leftcorner,x=unit(1,mm),y=unit(1,npc)-unit(1,mm),just=c(left,top))pushViewport(viewport(width=0.8,height=0.5,angle=10,name=vp2))grid.rect()grid.text(top-leftcorner,x
本文标题:R绘图系统6
链接地址:https://www.777doc.com/doc-2856345 .html