Skip to content
Prev 392436 / 398502 Next

lattice question

On Thu, Aug 11, 2022 at 9:03 PM Naresh Gurbuxani <
naresh_gurbuxani at hotmail.com> wrote:

            
In that case, this alternative approach may be conceptually simpler:

library(latticeExtra)

r <- with(mydf, extendrange(range(long, short)))

plong <- xyplot(long ~ date, groups = name, data = mydf,
                type = "l", grid = TRUE,
                ylim = r)

pshort <- xyplot(short ~ date, groups = name, data = mydf, type = "l")

plong + pshort

The first plot here is the "main" one, so you need to make sure that its
'ylim' is big enough for all the data.

-Deepayan