ImageVerifierCode 换一换
格式:DOCX , 页数:11 ,大小:56.81KB ,
资源ID:24684391      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/24684391.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(R绘图系统7.docx)为本站会员(b****3)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

R绘图系统7.docx

1、R绘图系统77.1grid.rect(gp=gpar(col=gray)grid.circle(name=circles, x=seq(0.1, 0.9, length=40), y=0.5 + 0.4*sin(seq(0, 2*pi, length=40), r=abs(0.1*cos(seq(0, 2*pi, length=40)grid.edit(circles, gp=gpar(col=gray(c(1:20*0.04, 20:1*0.04)grid.remove(circles)7.2grid.rect(gp=gpar(col=gray)suffix - c(even, odd)fo

2、r (i in 1:8) grid.circle(name=paste(circle., suffixi % 2 + 1, sep=), r=(9 - i)/20, gp=gpar(col=NA, fill=gray(i/10)grid.edit(circle.odd, gp=gpar(fill=gray10), global=TRUE)grid.edit(circle, gp=gpar(col=gray, fill=gray90), grep=TRUE, global=TRUE) 7.3labels - c(xaxis1nxaxis gTree, majornlines grob, tick

3、snlines grob, labelsntext grob)names - c(, major, ticks, labels)boxheight - unit(2.5, line)boxwidth - unit(1.2, in)pushViewport(viewport(layout=grid.layout(2, 3)pushViewport(viewport(layout.pos.row=1, layout.pos.col=2)grid.text(labels1)grid.lines(unit(0.5, npc) + unit.c(-0.5*boxwidth, 0.5*boxwidth),

4、 0.5, gp=gpar(col=gray)grid.roundrect(height=boxheight, width=boxwidth, # 1.2*stringWidth(labels1), r=unit(2, mm), gp=gpar(fill=NA)popViewport()pushViewport(viewport(layout.pos.row=2, layout.pos.col=1)grid.text(labels2)grid.lines(unit(0.5, npc) + unit.c(-0.5*boxwidth, 0.5*boxwidth), 0.5, gp=gpar(col

5、=gray)grid.roundrect(height=boxheight, width=boxwidth, # 1.2*stringWidth(labels2), r=unit(2, mm), gp=gpar(fill=NA)popViewport()pushViewport(viewport(layout.pos.row=2, layout.pos.col=2)grid.text(labels3)grid.lines(unit(0.5, npc) + unit.c(-0.5*boxwidth, 0.5*boxwidth), 0.5, gp=gpar(col=gray)grid.roundr

6、ect(height=boxheight, width=boxwidth, # 1.2*stringWidth(labels3), r=unit(2, mm), gp=gpar(fill=NA)popViewport()pushViewport(viewport(layout.pos.row=2, layout.pos.col=3)grid.text(labels4)grid.lines(unit(0.5, npc) + unit.c(-0.5*boxwidth, 0.5*boxwidth), 0.5, gp=gpar(col=gray)grid.roundrect(height=boxhei

7、ght, width=boxwidth, # 1.2*stringWidth(labels4), r=unit(2, mm), gp=gpar(fill=NA)popViewport()pushViewport(viewport(layout.pos.row=1, layout.pos.col=2)grid.move.to(x=0.5, y=unit(0.5, npc) - 0.5*boxheight)popViewport()pushViewport(viewport(layout.pos.row=2, layout.pos.col=1)grid.line.to(x=0.5, y=unit(

8、0.5, npc) + 0.5*boxheight, arrow=arrow(angle=10, length=unit(3, mm)popViewport()pushViewport(viewport(layout.pos.row=1, layout.pos.col=2)grid.move.to(x=0.5, y=unit(0.5, npc) - 0.5*boxheight)popViewport()pushViewport(viewport(layout.pos.row=2, layout.pos.col=2)grid.line.to(x=0.5, y=unit(0.5, npc) + 0

9、.5*boxheight, arrow=arrow(angle=10, length=unit(3, mm)popViewport()pushViewport(viewport(layout.pos.row=1, layout.pos.col=2)grid.move.to(x=0.5, y=unit(0.5, npc) - 0.5*boxheight)popViewport()pushViewport(viewport(layout.pos.row=2, layout.pos.col=3)grid.line.to(x=0.5, y=unit(0.5, npc) + 0.5*boxheight,

10、 arrow=arrow(angle=10, length=unit(3, mm)popViewport()7.4grid.rect(gp=gpar(col=gray)pushViewport(viewport(just=bottom, gp=gpar(cex=0.7)grid.xaxis(name=axis1, at=1:4/5)grid.ls()grid.edit(axis1, at=1:3/4)grid.edit(gPath(axis1, labels), rot=45)popViewport()7.5tg - textGrob(sample text)rg - rectGrob(wid

11、th=1.1*grobWidth(tg), height=1.3*grobHeight(tg)boxedText - gTree(children=gList(tg, rg)pushViewport(viewport(layout=grid.layout(1, 7, heights=unit(1.25, in), widths=unit(rep(c(1, 1.25), length=7), rep(c(null, in), length=7)pushViewport(viewport(layout.pos.col=2, gp=gpar(fill=NA)grid.rect(gp=gpar(col

12、=gray, fill=NA)grid.draw(boxedText)popViewport()pushViewport(viewport(layout.pos.col=4, gp=gpar(fill=NA)grid.rect(gp=gpar(col=gray, fill=NA)grid.draw(editGrob(boxedText, gp=gpar(col=gray)popViewport()pushViewport(viewport(layout.pos.col=6, gp=gpar(fill=NA)grid.rect(gp=gpar(col=gray, fill=NA)grid.dra

13、w(editGrob(boxedText, vp=viewport(angle=45), gp=gpar(fontsize=18) popViewport()popViewport() 7.6label - textGrob(AnPlotnLabel , x=0, just=left)x - seq(0.1, 0.9, length=50)y - runif(50, 0.1, 0.9)gplot - gTree( children=gList(rectGrob(gp=gpar(col=gray60, fill=white), linesGrob(x, y), pointsGrob(x, y,

14、pch=16, size=unit(1.5, mm), vp=viewport(width=unit(1, npc) - unit(5, mm), height=unit(1, npc) - unit(5, mm)layout - grid.layout(1, 2, widths=unit(c(1, 1), c(null, grobwidth), list(NULL, label)grid.rect(gp=gpar(col=gray60, fill=gray90)pushViewport(viewport(layout=layout)pushViewport(viewport(layout.p

15、os.col=2)grid.draw(label)popViewport()pushViewport(viewport(layout.pos.col=1)grid.draw(gplot)popViewport(2)7.7tg1 - textGrob(Sample)rg1 - rectGrob(x=rep(0.5, 2), width=1.1*grobWidth(tg1), height=1.3*grobHeight(tg1), gp=gpar(col=c(gray60, white), lwd=c(3, 1)pushViewport(viewport(layout=grid.layout(1,

16、 7, heights=unit(1.25, in), widths=unit(rep(c(1, 1.25), length=7), rep(c(null, in), length=7)pushViewport(viewport(layout.pos.col=2, gp=gpar(fill=NA)grid.rect(gp=gpar(col=gray, fill=NA)grid.draw(tg1)grid.draw(rg1)popViewport()pushViewport(viewport(layout.pos.col=4, gp=gpar(fill=NA)grid.rect(gp=gpar(

17、col=gray, fill=NA)pushViewport(viewport(gp=gpar(cex=2)grid.draw(tg1)grid.draw(rg1)popViewport()popViewport()pushViewport(viewport(layout.pos.col=6, gp=gpar(fill=NA)grid.rect(gp=gpar(col=gray, fill=NA)pushViewport(viewport(gp=gpar(cex=2)grid.draw(tg1)popViewport()grid.draw(rg1)popViewport()popViewpor

18、t()7.8tg1 - textGrob(Sample, name=tg1)rg1 - rectGrob(width=1.1*grobWidth(tg1), height=1.3*grobHeight(tg1), gp=gpar(col=gray60, lwd=3)rg2 - rectGrob(width=1.1*grobWidth(tg1), height=1.3*grobHeight(tg1), gp=gpar(col=white)grid.rect(gp=gpar(col=gray)pushViewport(viewport(gp=gpar(cex=1.5, fill=NA)grid.d

19、raw(tg1)grid.draw(rg1)grid.draw(rg2)grid.edit(tg1, grep=TRUE, global=TRUE, label=Different text)popViewport()7.9grid.rect(gp=gpar(col=gray)pushViewport(viewport(gp=gpar(fill=NA)grid.circle(.25, .5, r=unit(1, mm), gp=gpar(fill=black)grid.text(A label, .75, .5)grid.rect(.75, .5, width=stringWidth(A la

20、bel) + unit(2, mm), height=unit(1, line), name=labelbox)grid.segments(.25, .5, grobX(labelbox, 180), .5, arrow=arrow(angle=15, type=closed), gp=gpar(fill=black)7.10pushViewport(viewport(gp=gpar(fill=NA)vptop - viewport(width=.9, height=.4, y=.75, name=vptop)vpbot - viewport(width=.9, height=.4, y=.2

21、5, name=vpbot)pushViewport(vptop)upViewport()pushViewport(vpbot)upViewport()grid.rect(vp=vptop)grid.lines(1:50/51, runif(50), vp=vptop)grid.rect(vp=vpbot)grid.lines(1:50/51, runif(50), vp=vpbot)grid.null(x=.2, y=.95, vp=vptop, name=tl)grid.null(x=.4, y=.95, vp=vptop, name=tr)grid.null(x=.2, y=.05, v

22、p=vpbot, name=bl)grid.null(x=.4, y=.05, vp=vpbot, name=br)grid.polygon(unit.c(grobX(tl, 0), grobX(tr, 0), grobX(br, 0), grobX(bl, 0), unit.c(grobY(tl, 0), grobY(tr, 0), grobY(br, 0), grobY(bl, 0), gp=gpar(col=gray, lwd=3)7.11grid.rect(gp=gpar(col=gray)grid.circle(r=0.3, gp=gpar(fill=gray80), name=my

23、circle)grid.edit(mycircle, gp=gpar(lwd=5)grid.edit(mycircle, gp=gpar(lty=dashed)7.12angle - seq(0, 2*pi, length=21)-21x - cos(angle)y - sin(angle)trellis.par.set(theme = canonical.theme(postscript, color=FALSE)print(xyplot(y x, aspect=1, xlab=displacement, ylab=velocity)grid.edit(.xlab$, grep=TRUE,

24、x=unit(1, npc), just=right, gp=gpar(fontfamily=mono)grid.edit(.ylab$, grep=TRUE, y=unit(1, npc), just=right, gp=gpar(fontfamily=mono)7.13mtcars2 - mtcarsmtcars2$trans - factor(mtcars$am, levels=0:1, labels=c(automatic, manual)mtcars2$am - NULLmtcars2$vs - NULLmtcars2$drat - NULLmtcars2$carb - NULLup

25、date_geom_defaults(smooth, aes(color=black)print(ggplot(mtcars2, aes(x=disp, y=mpg) + geom_point() + geom_smooth(method=lm)downViewport(panel.3-4-3-4)sline - grid.get(gPath(smooth, polyline), grep=TRUE)grid.segments(.7, .8, grobX(sline, 45), grobY(sline, 45), arrow=arrow(angle=10, type=closed), gp=gpar(fill=black)grid.text(line of best fit, .71, .81, just=c(left, bottom)

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1