Dear all, I would like to plot multiple graphs in the same window. For this I used: par(mfcol=c(5,2) ) and then I use plot(x,y) to fill the cells of the window with the graphs. This results in multiple graphs with a lot of space around each graph. But I would like the 5 graphs in each column to be 'connected' (i.e., no space around them) and to specify values and label on the x-axis only for the lowest graph in each column. Does anyone know how I can do this? I considered xyplot(y~x|z) from the lattice package, but I have different variables on the y-axis in each graph, so this does not seem to work? Thanks in advance for any suggestions, Marleen de Moor Dept. of Biological Psychology Free University Amsterdam mhm.de.moor@psy.vu.nl [[alternative HTML version deleted]]
Moor MHM.de wrote:> Dear all, > > > > I would like to plot multiple graphs in the same window. For this I > used: > > > > par(mfcol=c(5,2) ) > > > > and then I use plot(x,y) to fill the cells of the window with the > graphs. > > > > This results in multiple graphs with a lot of space around each graph. > > But I would like the 5 graphs in each column to be 'connected' (i.e., no > space around them) and to specify values and label on the x-axis only > for the lowest graph in each column.See ?par, e.g. set par(mar = rep(0,4)) for the inner plots. Uwe Ligges> > > Does anyone know how I can do this? I considered xyplot(y~x|z) from the > lattice package, but I have different variables on the y-axis in each > graph, so this does not seem to work? > > > > Thanks in advance for any suggestions, > > Marleen de Moor > > > > Dept. of Biological Psychology > > Free University Amsterdam > > mhm.de.moor at psy.vu.nl > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
You can use par(mai=_yourValues_) For instance: > par(mfcol=c(5,2) ) > par(mai=c(0,0,0,0)) > replicate(10,plot(1:10)) Modify the mai parameter and arguments in the plot() function to get better results, hope this helps, vito Moor MHM.de wrote:> Dear all, > > > > I would like to plot multiple graphs in the same window. For this I > used: > > > > par(mfcol=c(5,2) ) > > > > and then I use plot(x,y) to fill the cells of the window with the > graphs. > > > > This results in multiple graphs with a lot of space around each graph. > > But I would like the 5 graphs in each column to be 'connected' (i.e., no > space around them) and to specify values and label on the x-axis only > for the lowest graph in each column. > > > > Does anyone know how I can do this? I considered xyplot(y~x|z) from the > lattice package, but I have different variables on the y-axis in each > graph, so this does not seem to work? > > > > Thanks in advance for any suggestions, > > Marleen de Moor > > > > Dept. of Biological Psychology > > Free University Amsterdam > > mhm.de.moor at psy.vu.nl > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >-- ===================================Vito M.R. Muggeo Dip.to Sc Statist e Matem `Vianelli' Universit? di Palermo viale delle Scienze, edificio 13 90121 Palermo - ITALY tel: 091 6626240 fax: 091 485726/485612