Opens a PDF device in A4 paper format. After calling this function all plots
go into the specified PDF file in pdfFile
. Important: The PDF file
needs to be closed explicitely with grDevices::dev.off() after all desired
plots have been made.
preparePdf(pdfFile = tempfile(fileext = ".pdf"), landscape = TRUE, borderWidth.cm = 2, borderHeight.cm = 2, width.cm = .defaultWidth(landscape, borderWidth.cm, borderHeight.cm), height.cm = .defaultHeight(landscape, borderWidth.cm, borderHeight.cm), makeCurrent = TRUE, paper = paste0("a4", ifelse(landscape, "r", "")), ...)
pdfFile | Full path to PDF file to be created |
---|---|
landscape | If |
borderWidth.cm | (Total) border width in "width" direction in cm |
borderHeight.cm | (Total) border width in "height" direction in cm |
width.cm | page width in cm. Default according to DIN A4 |
height.cm | page height in cm. Default according to DIN A4 |
makeCurrent | if |
paper | passed to |
… | further arguments passed to |
full path to pdf file
# NOT RUN { # Open PDF file by giving a path to preparePdf(). The path is returned. pdf_file <- preparePdf(file.path(tempdir(), "example_preparePdf.pdf")) # Plot something plot(x <- seq(-pi,pi,pi/100), sin(x), type = "l") # Open PDF file in viewer finishAndShowPdf(pdf_file) # }