ProducePlot: Wrapper function for plotting ggplot2 PDFs

Description Usage Arguments Examples

Description

Wrapper function for plotting ggplot2 PDFs

Usage

1
ProducePlot(filename, plot.obj, page.size = "A4", landscape = TRUE)

Arguments

plot.obj

- a ggplot2 object

plot.filename

- the filename for the plot

page.size='A4'

- used to specify page size, can be A3

landscape=TRUE

- used to specify page orientation

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 

x.vals<-c(1,2,3)
y.vals<-c(2,4,6)
plot.data<-data_frame(x.vals,y.vals)
p<-ggplot(data = plot.data,aes(x=x.vals,y=y.vals))
p<-p+geom_line(size=0.5)
p<-p+geom_point(size=2)
titleStr<-'A simple plot'
p<-p+labs(title = titleStr)

print(p)

file.name<-'A good file name.pdf'
ProducePlot(file.name,plot.obj=p)

## End(Not run)

StatsResearch/RobsRUtils documentation built on May 9, 2019, 3:04 p.m.