[R] xyplot: several plots in one creates y-scale problem

Jay josip.2000 at gmail.com
Sun Jan 3 00:09:27 CET 2010


Hello,

I've been looking for a solution to this problem for some time now but
I seem unable to solve it.. so this is the case: I want to plot 4 time
series in the same graph using xyplot(). When I do this with

xyplot(mydata[,2]+mydata[,3]+mydata[,4]+mydata[,5] ~ mydata[,1], data
= mydata,
        type = "l",
        auto.key = list(space="right", lines = T, points = F),
        par.settings = simpleTheme(lty = c(1,2,3,4))
        )

I get a graph where all lines are "maximized" to cover the entire y-
scale width. I.e., they are use their own scale independent of each
other (my data has some columns that are one magnitude smaller than
the others). How do I force them all to use the same y-scale?

I found this thread: http://n4.nabble.com/superimposing-xyplots-on-same-scale-td905525.html,
but  I'm not really sure what is going on there. Any ideas?

/J



More information about the R-help mailing list