I think the problem is that there is clearly no index in the plot. Try the following:
set.seed(1)
a = rnorm(200)
plot(a, type="l", main="rnorm(200)")
This is similar to what you have. It is also equivalent plot(1:length(a), a, ...)where 1:length(a)- your xand a- yours y.

With this in mind, we can flip the chart as follows:
plot(a, 1:length(a), type="l", main="rnorm(200)")

source
share