ABSTRACT

Graphics are an important part of reports, and a lot of efforts have been made in knitr to make sure graphics output is natural and flexible. For HTML output, we usually use raster images, but nowadays most Web browsers also support SVG as a format of vector graphics. One obvious advantage of vector graphics over raster graphics is their high quality, e.g., we can zoom in or zoom out a SVG image without loss of quality. The chunk options are passed to the graphical device to set the width and height of a plot, and the plot may be rescaled in the output using different options. All the plots in a code chunk are first recorded as R objects by the evaluate package and then "replayed" inside a graphical device to generate plot files. There are animation examples in both the main manual and graphics manual of knitr, which can be found on the package website.