0

enter image description hereI have the following shiny code that generates the attached image. I'm trying to figure out if there is a way to get the y-axis tick labels to match the colors of the stacked barplot (so we know what color matches what label)?

{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

Jonenter image description here

DocWeen
  • 13
  • 4
  • 2
    [This answer](https://stackoverflow.com/a/38862452/496488) might help. – eipi10 Mar 29 '18 at 18:29
  • Hey thanks eipi10. Looks like the answer lies in ggplot making legends and plot() labeling the y-axis tick marks. Can't colorize the tick marks in plot() but legend in ggplot is fine. BUT, plot(), will adjust the WIDTH of each bar in the time series based on the size of that group, which is helpful. Is there a way to do that in ggplot? Thx again. – DocWeen Apr 02 '18 at 17:35

0 Answers0