
PNG Graphics ============<img src="plot.png"/>Pros : * You can produce **any** R plot Cons : * The graphic is **static** * Raster graphics **do not scale** SVG Graphics ============ ```r svg("plot.svg") print(latticePlot) dev.off() ```

SVG Graphics ============<img src="plot.svg"/>Pros : * You can produce **any** R plot * Vector graphics **scale** Cons : * The graphic is **static** * You are **limited to R graphics concepts** gridSVG Graphics ================ ```r library(gridSVG) ``` ```r gridsvg("gridsvg-plot.svg", prefix="gridsvg-") print(latticePlot) dev.off() ``` gridSVG Graphics ================
<img src="gridsvg-plot.svg"/>Cons : * You can only produce **graphics based on grid** Pros : * Vector graphics **scale** * You have access to **SVG concepts** R Graphics ==========

gridSVG: Only grid-based output ================ ```r png("graphics.png") plot(mpg ~ disp, mtcars) dev.off() ```
gridSVG: Only grid-based output ================ ```r gridsvg("graphics.svg") plot(mpg ~ disp, mtcars) dev.off() ``` gridSVG: The grid Display List ======= ```r gridsvg("gridsvg-plot.svg", prefix="gridsvg-") print(latticePlot) dev.off() ```<img src="gridsvg-plot.svg"/>Cons : * You can only produce **graphics based on grid** Pros : * Vector graphics **scale** * You have access to **SVG concepts** R Graphics ==========

SVG concepts: Tooltips ================ ```r gridsvg("tooltip.svg", prefix="tooltip-") print(latticePlot) grid.garnish("points", grep=TRUE, group=FALSE, title=paste("x =", mtcars$disp, " y =", mtcars$mpg)) dev.off() ``` SVG concepts: Hyperlinks ======== ```r gridsvg("hyperlink.svg", prefix="hyperlink-") print(latticePlot) grid.hyperlink("plot_01.main", href="mtcars.html") dev.off() ``` SVG concepts: Hyperlinks ========