R 控制坐标画图参数
2016-04-14 15:47
543 查看
ILoveLittree
1.关闭x或者y轴的lab:xaxt='n'
or yaxt="n"
2.关闭整个plot的窗口:axes=F
3.调整lab的字体大小:cex.lab=lab.size
4.调整轴的字体大小cex.axis=axis.size
5.调整轴元素之间的距离:mgp=c(2.5,1,0)
mgp:坐标轴各部件的位置。第一个元素为坐标轴位置到坐标轴标签的距离,以文本行高为单位。第二个元素为坐标轴位置到坐标刻度标签的距离。第三个元素为坐标轴位置到实际画的坐标轴的距离,通常是0。
6.axis(1,at=half.len,labels=’test’,tick=F) #tick 控制坐标轴上的小竖线是否显示
7: X,Y轴互换用horiz=TRUE
8: axis labels的方向 las=0 0,1,2,3
以例子示范:
plot(1:10,1:10,xlab="x",ylab="y",main="ILoveLittree",cex.axis=0.8,cex.lab=2,mgp=c(3,2,1))
更新ing
png("filename.png",width=500,height=500)
par(oma=c(3,3,3,3),mar=c(5,10,5,5),mgp=c(3,2,1),bty="o",xaxt='n')
plot(1:10,1:10,xlab="x",ylab="y",main="ILoveLittree",cex.axis=0.8,cex.lab=2)
box("inner", lty="dotted", col="red")
box("outer", lty="solid", col="blue")
mtext("Made by ILoveLittree", side=1, cex.lab=1.3, line=1, cex=1.2,font.axis=2,outer=TRUE,adj=0)
dev.off()
结合前一次的博客:http://blog.sina.com.cn/s/blog_6babbcb801019njz.html
糗世界: http://pgfe.umassmed.edu/ou/archives/2395
R: http://research.stowers-institute.org/mcm/efg/R/Graphics/Basics/mar-oma/index.htm
1.关闭x或者y轴的lab:xaxt='n'
or yaxt="n"
2.关闭整个plot的窗口:axes=F
3.调整lab的字体大小:cex.lab=lab.size
4.调整轴的字体大小cex.axis=axis.size
5.调整轴元素之间的距离:mgp=c(2.5,1,0)
mgp:坐标轴各部件的位置。第一个元素为坐标轴位置到坐标轴标签的距离,以文本行高为单位。第二个元素为坐标轴位置到坐标刻度标签的距离。第三个元素为坐标轴位置到实际画的坐标轴的距离,通常是0。
6.axis(1,at=half.len,labels=’test’,tick=F) #tick 控制坐标轴上的小竖线是否显示
7: X,Y轴互换用horiz=TRUE
8: axis labels的方向 las=0 0,1,2,3
0: always parallel to the axis [default],
1: always horizontal,
2: always perpendicular to the axis,
3: always vertical.
以例子示范:
plot(1:10,1:10,xlab="x",ylab="y",main="ILoveLittree",cex.axis=0.8,cex.lab=2,mgp=c(3,2,1))
更新ing
png("filename.png",width=500,height=500)
par(oma=c(3,3,3,3),mar=c(5,10,5,5),mgp=c(3,2,1),bty="o",xaxt='n')
plot(1:10,1:10,xlab="x",ylab="y",main="ILoveLittree",cex.axis=0.8,cex.lab=2)
box("inner", lty="dotted", col="red")
box("outer", lty="solid", col="blue")
mtext("Made by ILoveLittree", side=1, cex.lab=1.3, line=1, cex=1.2,font.axis=2,outer=TRUE,adj=0)
dev.off()
结合前一次的博客:http://blog.sina.com.cn/s/blog_6babbcb801019njz.html
糗世界: http://pgfe.umassmed.edu/ou/archives/2395
R: http://research.stowers-institute.org/mcm/efg/R/Graphics/Basics/mar-oma/index.htm
相关文章推荐
- R语言 R6Class 读取Ini文件
- R语言书籍的学习路线图
- R语言学习-统计之都
- R的若干基因及争论
- R语言初识
- 浅谈R语言的面向对象编程
- 查找一个list中各个数组的元素在一个固定数组中的位置, 并把位置信息记录到一个矩阵里
- ubuntu 启动 RStudio, 提示缺少libgstreamer-0.10.so.0
- 常用的分类评估--基于R语言
- r语言自带数据包
- 灰色系统模型GM(1,1)的R语言实现
- R语言实现两服务员并联服务系统简单随机模拟
- best tool for R
- R语言基础-矩阵和列表
- R语言基础绘图包--控制axis label位置--par(mgp)与mtext
- 如何学习R语言?
- 基于数据分析的评分系统改进
- R语言入门学习-搭建R语言环境
- R语言与机器学习-学习笔记2(数据探索及理解)
- R语言学习 apply