plot.xts()x轴刻度标签格式和y轴标签[R]

plot.xts()x轴刻度标签格式和y轴标签[R],r,plot,xts,R,Plot,Xts,询问有关plot.xts()格式的后续问题。几分钟前我问了一个类似的问题,得到了充分的回答。代码和打印输出包括在下面: ## Reformat UST time series ust <- merge.xts(us.3m, us.6m, us.2y, us.3y, us.5y, us.10y, us.30y) ## Generate color schema for plot asdf <- as.zoo(ust) tsRainbow = rainbow(ncol(asdf))

询问有关
plot.xts()
格式的后续问题。几分钟前我问了一个类似的问题,得到了充分的回答。代码和打印输出包括在下面:

## Reformat UST time series
ust <- merge.xts(us.3m, us.6m, us.2y, us.3y, us.5y, us.10y, us.30y)

## Generate color schema for plot
asdf <- as.zoo(ust)
tsRainbow = rainbow(ncol(asdf))

## Plot bond yield evolution graph
plot.xts(ust, screens=1,
         major.ticks="years",
         main="U.S. Bond Yield Evolution", ylab="Bond Yield (%)",
         major.format="%Y",
         yaxis.right=FALSE, yaxis.left=TRUE,
         grid.ticks.on="years", col=tsRainbow)
## Add legend to graph using same color schema
addLegend("topright", 
          legend.names=c("US 3M", "US 6M", "US 2Y", "US 3Y", "US 5Y", "US 10Y", "US 30Y"),
          col=tsRainbow, 
          lty=c(1,1,1,1,1,1,1), lwd=c(2,2,2,2,2,2,2),
          ncol=2, bg="white", bty="o")
##重新格式化UST时间序列
对于(2),我能想到的最好办法是将x轴从zoo转换为as.yearqtr()。它将显示为(20XX-Q1)。对于(2),我能想到的最好方法是将x轴从zoo转换为as.yearqtr()。它将显示为(20XX-Q1)。