1

I am trying to change an individual y-labels from a stacked plot with R. I am trying to capitalize each label, and reduce the font size to avoid overlapping. However, I have not found how to do it. Please view the attached image and my code.

Plot

png(filename = 'Decompose.png', width = 20, height = 10, units = 'cm', res=600)
df_timeseries_components <- decompose(df_timeseries)
p0 <- plot(df_timeseries_components, xlab = 'Number of weeks')
dev.off()
  • 1
    Those labels look to be hardcoded into the `plot.decomposed.ts` function. However, that function is fairly short, you can view the code by entering `stats:::plot.decomposed.ts` in your console, and you could fairly easily modify at least the capitalization. – Gregor Thomas Nov 29 '22 at 20:50
  • 1
    That said, you might want to use `stl()` instead of `decompose()` - the decompose help page notes that *"The function `stl` provides a much more sophisticated decomposition"*, and the plot method for `stl` is a bit more flexible, see `?plot.stl`. – Gregor Thomas Nov 29 '22 at 20:52

0 Answers0