【发布时间】:2017-05-30 15:56:55
【问题描述】:
这是我在 R 图中使用的日期
dates <- c("2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008",
"2009", "2010", "2011", "2012", "2013", "2014", "2015", "2016", "2017")
当我绘制图表时,这里是代码,日期仅以 5 年为间隔显示,而不是每年显示。
plot(x = dates, y=Comp_selected_DF[idx_country, 2:18], type = "l"
, xlab = "", ylab = "", col="grey20", ylim = c(-2, overall_max_z), lwd=3)
mtext("Financial Vulnerability Indicator", side=3, adj=0, line=1.2, cex=2, font=2)
mtext("Z-Score", side=3, adj=0, line=0.1, cex=1, font=0.5)
lines(dates, Bank_selected_DF[idx_country, 2:18], col="green2", lwd=3)
lines(dates, Curr_selected_DF[idx_country, 2:18], col="purple", lwd=3)
lines(dates, Sover_selected_DF[idx_country, 2:18], col="red", lwd=3)
lines(dates, Sudden_selected_DF[idx_country, 2:18], col="orange", lwd=3)
legend(
"bottom",
lty=c(1,1,1,1),
col=c("grey20", "green2", "purple", "red", "orange"),
legend = c("Composite", "Banking", "Currency", "Sovereign", "Sudden Stop")
,ncol=5
)
【问题讨论】:
-
如果将
las=2添加到绘图函数会发生什么?