使用R进行数据可视化套路之-散点图、图形分隔、时间序列
2013-10-27 16:08
309 查看
代码
效果
## Panel A par(fig=c(0, 1, .45, 1)) #图像设备分割 plot(log10(measles), xlab="时间", ylab=" Deaths; Population (log scale)", ylim=log10 (c(1,5000*1000)), yaxt="n") ytiks <- c(1, 10, 100, 1000, 1000000, 5000000) axis(2, at=log10(ytiks), labels=paste(ytiks), las=2) #坐标轴标记 ## London population in thousands londonpop <- ts(c(1088,1258,1504,1778,2073,2491,2921,3336,388,4563,4541,4498,4408), start=1801, end=1931, deltat=10) #创建时序数据 points(log10(londonpop*1000), pch=16, cex=.5) mtext(side=3, line=0.5, "A (1629-1939)", adj=0) ## Panel B par(fig=c(0, 1, 0, .45), new=TRUE) plot(window(measles, start=1840, end=1882),xlab="时间", ylim=c(0, 4600), yaxt="n") #使用window函数进行时序序列区间数据截取 axis(2, at=(0:4)* 1000, labels=paste(0:4), las=2) points(londonpop, pch=16, cex=.5) mtext(side=3, line=0.5, "B (1841-1881)", adj=0)
效果
相关文章推荐
- 考试系统——CS文件中不识别Web窗体控件
- [原]考试系统——CS文件中不识别Web窗体控件
- [原]考试系统——CS文件中不识别Web窗体控件
- Zend Framework中,执行自定义sql语句
- Zend Framework中,执行自定义sql语句 推荐
- SCCM 2012 R2 体验之旅-先决条件准备(1)
- Android播放HLS协议的流媒体
- 寄语笑笑 推荐
- Java基本数据类型
- mysql数据库常用的查询语句(多表查询)
- DLL如何导出函数
- if语句在判定后会产生一个值:true or false !
- 【Android基础入门〖19〗】ExpandableListView酷我音乐界面的下拉菜单
- 有重复元素的排序问题
- 数值类型转换规则以及进制转换
- Java编程经验汇总
- ORA-00257: archiver error. Connect internal only, until freed
- jodaTime 优秀的日期框架
- 自加++的应用
- ORA-00257: archiver error. Connect internal only, until freed 错误的处理方法