我有以下闪亮的代码来生成附加图像。我试图弄清楚是否有办法让y轴刻度标签与堆积的条形图的颜色相匹配(所以我们知道哪种颜色与标签相匹配)?
{r dispo, echo=FALSE, warning=FALSE, message=FALSE}
par(cex.axis = 0.75, las = 1)
plot(RHSSP$quarter, RHSSP$Dispo, col = chs, xlab = "Quarter", ylab = "DC", cex = 0.5)
text(x = RHSSP$quarter, cex = 0.75, adj = 1, srt = 45, xpd = TRUE)
title(main = "Disposition by quarter")
THX