Learn R Programming

knitr (version 1.28)

plot_crop: Crop a plot (remove the edges) using PDFCrop or ImageMagick

Description

The command pdfcrop (often shipped with a LaTeX distribution) is executed on a PDF plot file, and magick::image_trim() is executed for other types of plot files.

Usage

plot_crop(x, quiet = TRUE)

Arguments

x

Filename of the plot.

quiet

Whether to suppress standard output from the command.

Value

The original filename.

References

PDFCrop: https://www.ctan.org/pkg/pdfcrop. If you use TinyTeX, you may install pdfcrop with tinytex::tlmgr_install('pdfcrop').