Re: [R] multiple mosaic plots layout

From: Achim Zeileis <Achim.Zeileis_at_uibk.ac.at>
Date: Mon, 02 May 2011 09:23:32 +0200 (CEST)

On Mon, 2 May 2011, baptiste auguie wrote:

> Unfortunately, it seems that vcd doesn't return grobs but draws
> directly to the device, which prevents a concise solution.

Yes. The reason is that vcd was first written before grobs were available.

When we need multiple plots in a single layout, we use Baptiste's second (more verbose) solution. A worked example is included in ?Ord_plot.

> You could try the following,
>
> library(gridExtra)
> library(vcd)
> data("Titanic")
>
> p = grid.grabExpr(mosaic(Titanic))
> grid.arrange(p, p, p, ncol=2)
>
> Or, more versatile but also more verbose,
>
> pushViewport(...)
> mosaic(...)
> upViewport()
> pushViewport(...)
> mosaic(...)
> upViewport()
> etc..
>
> HTH,
>
> baptiste
>
> On 2 May 2011 11:32, Neuwirth Erich <erich.neuwirth_at_univie.ac.at> wrote:
>> I would like to display multiple mosaic plots from vcd (not defined by a model but derived from different data sets)
>> side by side.
>> Neither par(mfrow=...)
>> nor layout seem to allow to arrange multiple mosaic plots in a grid.
>> Is there an easy way of arranging mosaics in a grid?
>>
>> ______________________________________________
>> R-help@r-project.org mailing list
>> 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.
>>
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> 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.
>



R-help_at_r-project.org mailing list
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. Received on Thu 05 May 2011 - 06:25:07 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 05 May 2011 - 07:00:06 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive