Re: [R] Lattice equivalent of par(mfrow = )

From: Michael Kubovy <kubovy_at_virginia.edu>
Date: Sun, 13 Jan 2008 07:40:32 -0500

Dear R-helpers,

On Jan 12, 2008, at 5:17 PM, Deepayan Sarkar wrote:

> On 1/12/08, Michael Kubovy <kubovy@virginia.edu> wrote:
>> Dear r-helpers,
>>
>> Does anyone have a straightforward example of putting together three
>> unrelated (expect for a common y-axis) xyplot() figures in what would
>> be in base graphics a par(mfrow = c(1, 3)) arrangement?
>
> See the examples in ?print.trellis.

Thanks. Now how do I insure that the three y-axes are the same scale in the following?

states <- data.frame(state.x77,

                      state.name = dimnames(state.x77)[[1]],
                      state.region = state.region)
plot1 <- xyplot(Murder ~ Population, data = states,
	xlab = grid::textGrob(expression(frac(abs(bold(c)), abs(bold(b)))),  
gp=gpar(fontsize=25)),
	ylab = grid::textGrob(expression(paste(log, frac(italic(p) 
(italic(c)), italic(p)(italic(b))))), gp = gpar(fontsize = 25)), )
plot2 <- xyplot(Murder ~ Population, data = states,
	xlab = grid::textGrob(expression(gamma), gp = gpar(fontsize= 25)),
	ylab = '',

)
plot3 <- xyplot(Murder ~ Population, data = states,

        xlab =
grid::textGrob(expression(frac(abs( bold(c) ),abs( bold(b) ))), gp = gpar(fontsize = 25)),

        ylab = '',
)

print(plot1, position = c(0.0, 0, 0.33, 1), more = TRUE)
print(plot2, position = c(0.33, 0, 0.67, 1), more = TRUE)
print(plot3, position = c(0.67, 0, 1, 1))

_____________________________

Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS:     P.O.Box 400400    Charlottesville, VA 22904-4400
Parcels:    Room 102        Gilmer Hall
         McCormick Road    Charlottesville, VA 22903
Office:    B011    +1-434-982-4729
Lab:        B019    +1-434-982-4751
Fax:        +1-434-982-4766

WWW: http://www.people.virginia.edu/~mk9y/

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 Sun 13 Jan 2008 - 12:45:10 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 Sun 13 Jan 2008 - 23:30:05 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