- ggsave plot-spec filename #!key width height formatprocedure
Save to a file. format is inferred from the extension (.pdf, .png, .svg, .ps) or can be given explicitly as 'pdf, 'png, 'svg, or 'ps. .pdf works in every build via the native PDF backend and is the default when no extension or format is given; 'png, 'svg, and 'ps require the Cairo backend and raise an actionable error otherwise. width/height default to 800×600 (pixels for the Cairo formats; PDF page points for .pdf).