pngpdf: A plot wrapper function.

Description Usage Arguments Value Examples

Description

This function generates both png and pdf files for a given plot function.

Usage

1
2
3
pngpdf(plot.func, fprefix, width = 7, height = 7, pointsize = 12,
  add.date = TRUE, skip.png = FALSE, nplots = 1, png.res = 600,
  display.only = FALSE)

Arguments

plot.func

Any plotting function.

fprefix

The output png and pdf file path prefix. The file names will be fprefix.date.png and fprefix.date.pdf (date: eg.20150331)

width

The width of the png and pdf file in inches. Defaults to 7.

height

The height of the png and pdf file in inches. Defaults to 7.

pointsize

The pointsize of the png and pdf files.

add.date

If this is true, the output file names will be fprefix.date.png and fprefix.date.pdf (date: eg.20150331). If this is false, they will be fprefix.png and fprefix.pdf. Defaults to TRUE.

skip.png

If this is true, only pdf file will be generated. Defaults to FALSE.

nplots

The number of plots to be included in one page of the png file, stacked vertically. This is useful when producing a multi-page pdf file, since png does not support multi-page plotting. Each plot in the pdf and png files will not look exactly the same, so it is generally recommended to produce a single-page pdf and png. If nplots is larger than 6, it may not be able to generate a png file. In that case, try lowering png.res (resolution). Defaults to 1.

png.res

The resolution of png. Defaults to 600.

display.only

If TRUE, display the plot on the screen, and not produce png or pdf.

Value

the returned value from plot.func will be returned.

Examples

1
2
3
pngpdf(function(){
  plot(1:10,1:10,type="o",pch=19,col=3)
},"myplot")

SooLee/plotosaurus documentation built on May 9, 2019, 1:52 p.m.