Description Usage Arguments Examples
Wrapper function for plotting ggplot2 PDFs
1 | ProducePlot(filename, plot.obj, page.size = "A4", landscape = TRUE)
|
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 |
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.