Saves a ggplot2 object in publication-ready format with specified resolution.
Arguments
- plot
A ggplot2 object
- filename
Character. Output filename (extension determines format: .pdf, .png, .tiff, .svg)
- width
Numeric. Width in inches (default: 7)
- height
Numeric. Height in inches (default: 5)
- dpi
Numeric. Resolution for raster formats (default: 300 for publication)
- units
Character. Units: "in", "cm", "mm" (default: "in")
