multiple plots in R

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

multiple plots in R

Suyan Tian
Hi, I just try to draw multiple plots in one page using R, I used par  
command. For example I have 7 plots, but instead of arranging them in  
the default way

plot1    plot2  plot3
plot4   plot5   plot6
plot7

I want them in this order
plot1   plot2  plot3
plot4   plot5  plot6
             plot7

Could somebody tell me how to do this, please? Thanks so many.


Suyan

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: multiple plots in R

Sarah Goslee
You can use frame() to skip a place.

On Sun, Nov 23, 2008 at 9:19 PM, Suyan Tian <[hidden email]> wrote:

> Hi, I just try to draw multiple plots in one page using R, I used par
> command. For example I have 7 plots, but instead of arranging them in the
> default way
>
> plot1    plot2  plot3
> plot4   plot5   plot6
> plot7
>
> I want them in this order
> plot1   plot2  plot3
> plot4   plot5  plot6
>            plot7
>
> Could somebody tell me how to do this, please? Thanks so many.
>
>
--
Sarah Goslee
http://www.functionaldiversity.org

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: multiple plots in R

Sebastian P. Luque
In reply to this post by Suyan Tian
On Sun, 23 Nov 2008 18:19:19 -0800,
Suyan Tian <[hidden email]> wrote:

> Hi, I just try to draw multiple plots in one page using R, I used par
> command. For example I have 7 plots, but instead of arranging them in
> the default way

> plot1 plot2 plot3 plot4 plot5 plot6 plot7

> I want them in this order plot1 plot2 plot3 plot4 plot5 plot6 plot7

> Could somebody tell me how to do this, please? Thanks so many.


?layout


--
Seb

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: multiple plots in R

Felipe Carrillo
In reply to this post by Suyan Tian
Here's one way with ggplot2

library(ggplot2)
p <- qplot(mpg, wt, data=mtcars)
vplayout <- function(x, y)
viewport(layout.pos.row=x, layout.pos.col=y)
grid.newpage()
pushViewport(viewport(layout=grid.layout(3,3)))
print(p, vp=vplayout(1,1))
print(p, vp=vplayout(1,2))
print(p, vp=vplayout(1,3))
print(p, vp=vplayout(2, 1))
print(p, vp=vplayout(2, 2))
print(p, vp=vplayout(2, 3))
print(p, vp=vplayout(3, 3))

Felipe D. Carrillo  
Supervisory Fishery Biologist  
Department of the Interior  
US Fish & Wildlife Service  
California, USA




--- On Sun, 11/23/08, Suyan Tian <[hidden email]> wrote:

> From: Suyan Tian <[hidden email]>
> Subject: [R] multiple plots in R
> To: [hidden email]
> Date: Sunday, November 23, 2008, 6:19 PM
> Hi, I just try to draw multiple plots in one page using R, I
> used par command. For example I have 7 plots, but instead of
> arranging them in the default way
>
> plot1    plot2  plot3
> plot4   plot5   plot6
> plot7
>
> I want them in this order
> plot1   plot2  plot3
> plot4   plot5  plot6
>             plot7
>
> Could somebody tell me how to do this, please? Thanks so
> many.
>
>
> Suyan
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.