Description Usage Arguments Examples
Wrapper function for plotting ggplot2 in a more general output format
1 2 | OutputPlotForPaper(plot.dir, plot.folder, filename, plot.obj = NULL,
plot.width = NULL, plot.height = NULL, units = "in", res = 600)
|
plot.folder |
- output area for the plt |
plot.obj |
- a ggplot2 object |
plot.width |
- used to specify page size |
plot.height |
- used to specify page size |
plot.filename |
- the filename for the plot |
unit='in' |
- defaults to inches |
res=600 |
used by png output |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## 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)
plot.dir <- './'
file.name<-'A good file name.pdf'
OutputPlotForPaper(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.