ggplot2.multiplot : Put multiple graphs on the same page using ggplot2

Introduction

ggplot2.multiplot is an easy to use function to put multiple graphs on the same page using R statistical software and ggplot2 plotting methods. This function is from easyGgplot2 package.

Install and load easyGgplot2 package

easyGgplot2 R package can be installed as follow :

install.packages("devtools")
library(devtools)
install_github("easyGgplot2", "kassambara")

Load the package using this R code :

library(easyGgplot2)

Examples

# data.frame
df <- ToothGrowth
# Custom box plot with centered dot plot
plot1<-ggplot2.boxplot(data=df, xName='dose',yName='len',
                groupName='dose',
                addDot=TRUE, dotSize=1, showLegend=FALSE)
# Custom dot plot with centered dot plot
plot2<-ggplot2.dotplot(data=df, xName='dose',yName='len',
                groupName='dose',showLegend=FALSE)
# Custom strip chart with centered dot plot
plot3<-ggplot2.stripchart(data=df, xName='dose',yName='len',
                      groupName='dose', showLegend=FALSE)
# Notched box plot
plot4<-ggplot2.boxplot(data=df, xName='dose',yName='len',
                notch=TRUE)
# Multiple graphs on the same page
ggplot2.multiplot(plot1,plot2,plot3,plot4, cols=2)

Data visualization using ggplot2 : tutorial on how to put multiple graphs on the same page

ggplot2.multiplot function

Description

Put multiple graphs on the same page

usage

library(easyGgplot2)
ggplot2.multiplot(..., plotlist=NULL, cols=2)

Arguments

Arguments Descriptions
…, plotList List of ggplot2 objects separated by a comma. (e.g: plot1, plot2, plot3)
cols Number of columns in layout


Easy ggplot2 ebook

Note that an eBook is available on easyGgplot2 package here.

By Alboukadel Kassambara

Copyright 2014 Alboukadel Kassambara. All rights reserved.

Published by STHDA (http://www.sthda.com/english).

September 2014 : First edition.

Licence : This document is under creative commons licence (http://creativecommons.org/licenses/by-nc-sa/3.0/).

Contact : Alboukadel Kassambara alboukadel.kassambara@gmail.com


Infos

This analysis was performed using R (ver. 3.1.0), easyGgplot2 (ver 1.0.0) and ggplot2 (ver 1.0.0).


Enjoyed this article? I’d be very grateful if you’d help it spread by emailing it to a friend, or sharing it on Twitter, Facebook or Linked In.

Show me some love with the like buttons below... Thank you and please don't forget to share and comment below!!
Avez vous aimé cet article? Je vous serais très reconnaissant si vous aidiez à sa diffusion en l'envoyant par courriel à un ami ou en le partageant sur Twitter, Facebook ou Linked In.

Montrez-moi un peu d'amour avec les like ci-dessous ... Merci et n'oubliez pas, s'il vous plaît, de partager et de commenter ci-dessous!





This page has been seen 101723 times