R学习笔记 | 低级绘图函数
绘图函数:
(1) 高级绘图函数(plot()),可以画出整幅图;
(2) 低级绘图函数(point()、lines()、ablines()),在已画好的图中添加点、线。
一、ablines()
- 功能:添加直线或斜线
This function adds one or more straight lines through the current plot - POSIXct是时间类型
library(readxl)
stock<-read_excel('stock.xlsx')
plot(stock$date,stock$SH_closing_price,type='l',ylim=c(1500,13000))
abline(h=3000,v=as.POSIXct('2015-01-30'),col='grey') #添加了两条直线
二、lines()
- 功能:添加图形或线都可
(A generic function taking coordinates given in various ways and joining the corresponding points wi