I would like to place two separate plots, one above the other, something like this (MWE for illustration): library(lattice) data(iris) layout(matrix(c(1,2), 2, 1, byrow = TRUE)) with(iris, (plot(Sepal.Length ~ Petal.Length))) with(iris, (plot(Sepal.Length ~ Petal.Width))) but with lattice, so one of the plots can have panels. So something like this: library(lattice) data(iris) layout(matrix(c(1,2), 2, 1, byrow = TRUE)) xyplot(Sepal.Length ~ Petal.Length, data = iris) xyplot(Sepal.Length ~ Petal.Width | Species, data = iris, layout = c(3,1)) But the latter does not accomplish my goal. Appreciate any advice. Thanks. --Chris Ryan SUNY Upstate Medical University Binghamton, NY
arranging multiple lattice graphs on a page
4 messages · Christopher W. Ryan, Bert Gunter, Richard M. Heiberger
See ?print.trellis, especially the "split" argument. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Thu, Apr 2, 2020 at 2:23 PM Christopher W. Ryan <cryan at binghamton.edu> wrote:
I would like to place two separate plots, one above the other, something like this (MWE for illustration): library(lattice) data(iris) layout(matrix(c(1,2), 2, 1, byrow = TRUE)) with(iris, (plot(Sepal.Length ~ Petal.Length))) with(iris, (plot(Sepal.Length ~ Petal.Width))) but with lattice, so one of the plots can have panels. So something like this: library(lattice) data(iris) layout(matrix(c(1,2), 2, 1, byrow = TRUE)) xyplot(Sepal.Length ~ Petal.Length, data = iris) xyplot(Sepal.Length ~ Petal.Width | Species, data = iris, layout = c(3,1)) But the latter does not accomplish my goal. Appreciate any advice. Thanks. --Chris Ryan SUNY Upstate Medical University Binghamton, NY
______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Thanks, I'll take a look. I also finally came across gridExtra, which allows me to do it as well. --Chris Ryan
On April 2, 2020 6:45:58 PM EDT, Bert Gunter <bgunter.4567 at gmail.com> wrote:
See ?print.trellis, especially the "split" argument. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Thu, Apr 2, 2020 at 2:23 PM Christopher W. Ryan <cryan at binghamton.edu> wrote:
I would like to place two separate plots, one above the other,
something
like this (MWE for illustration): library(lattice) data(iris) layout(matrix(c(1,2), 2, 1, byrow = TRUE)) with(iris, (plot(Sepal.Length ~ Petal.Length))) with(iris, (plot(Sepal.Length ~ Petal.Width))) but with lattice, so one of the plots can have panels. So something
like
this: library(lattice) data(iris) layout(matrix(c(1,2), 2, 1, byrow = TRUE)) xyplot(Sepal.Length ~ Petal.Length, data = iris) xyplot(Sepal.Length ~ Petal.Width | Species, data = iris, layout =
c(3,1))
But the latter does not accomplish my goal. Appreciate any advice. Thanks. --Chris Ryan SUNY Upstate Medical University Binghamton, NY
______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Sent from my Android device with K-9 Mail. Please excuse my brevity. [[alternative HTML version deleted]]
don't forget library(latticeExtra) latticeExtra provides many very useful user-level functions.
On Thu, Apr 2, 2020 at 7:52 PM Christopher W. Ryan <cryan at binghamton.edu> wrote:
Thanks, I'll take a look. I also finally came across gridExtra, which allows me to do it as well. --Chris Ryan On April 2, 2020 6:45:58 PM EDT, Bert Gunter <bgunter.4567 at gmail.com> wrote:
See ?print.trellis, especially the "split" argument. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Thu, Apr 2, 2020 at 2:23 PM Christopher W. Ryan <cryan at binghamton.edu> wrote:
I would like to place two separate plots, one above the other,
something
like this (MWE for illustration): library(lattice) data(iris) layout(matrix(c(1,2), 2, 1, byrow = TRUE)) with(iris, (plot(Sepal.Length ~ Petal.Length))) with(iris, (plot(Sepal.Length ~ Petal.Width))) but with lattice, so one of the plots can have panels. So something
like
this: library(lattice) data(iris) layout(matrix(c(1,2), 2, 1, byrow = TRUE)) xyplot(Sepal.Length ~ Petal.Length, data = iris) xyplot(Sepal.Length ~ Petal.Width | Species, data = iris, layout =
c(3,1))
But the latter does not accomplish my goal. Appreciate any advice. Thanks. --Chris Ryan SUNY Upstate Medical University Binghamton, NY
______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.