I wanted to make a simple R chart with Y axis labels centered over the y axis label labels. I created something that I liked using the code below. But this required some distortion with the graphic parameter at.
Q: Is there a less hacky way to do this? Is there a way to request y-axis label labels for their width so that I can use this information to center the y-axis label over them?
set.seed(1)
n.obs <- 390
vol.min <- .20/sqrt(252 * 390)
eps <- rnorm(n = n.obs, sd = vol.min)
windows(width = 5.05, height = 3.8)
plot(eps, main = "Hello World!", las=1, ylab="")
mtext(text="eps", side=3, at=-60)

source
share