|
D<-read.csv('1年期数据.csv')
D$Date<-as.Date(D$Date)
str(D)
par(mar=c(4.1,4.1, 3.1, 4.1))
plot(D$Date,D$DF1Y,lty=2,col=1,type='l',ylab="汇率",xlab="",lwd=1.5,ylim=c(5.8,7))
lines(D$Date,D$St,lty=1,col=2,type='l',lwd=2)
par(new=TRUE)
plot(D$Date,D$Shibor1Y-D$Libor1Y,lty=3,col=3,type='l',yaxt="n",ylab="",xlab="",lwd=4)
axis(4)
legend("bottomright",legend=c("实际远期汇率","即期汇率","中美利率差"),lty=c(2,1,3),lwd=c(1.5,2,4),col=c(1,2,3),
bty='o',cex=1,text.font=0.3,horiz=FALSE)
text(locator(1),'2012.04.16')
text(locator(1),'2014.03.17')
|