我在ts.plot中无法获得红色和黑色两种颜色 要求(图形)
ts.plot(window(CPI_ts,
start=c(2012, 1),
end=c(2019, 12)),
window(IIP_ts,
start=c(2012, 1),
end=c(2019, 12)),
gpars=list(xlab="Year",
ylab="Index",
col=c("red", "blue"),
lwd=2))
legend("topleft", bty="n", lty=c(1,1), col=c("red","blue"),
legend=c(" IIP ", "CPI "))[CPI IIP index of india][1]