The gridGraphics package provides a function, grid.echo(), that can be used to convert a plot drawn with the graphics package to the same result drawn using grid. This provides access to a variety of grid tools for making customisations and additions to the plot that are not possible with the graphics package.
The gridGraphviz package renders node-and-edge graphs in R using the grid graphics package. Graphs are laid out using the Rgraphviz package to interface with the graph layout algorithms in graphviz. This article details the improvements made between gridGraphviz versions 0.2 and 0.3, including: support for “ellipse”- and “polygon”-shaped nodes; handling of edges in undirected graphs; support for various new arrow types; and support for edge labels. Version 0.3 also introduces a method to produce graphs with an overall size closer to graphviz’s output.
Ashley Noel Hinton and Paul Murrell
Statistical plots drawn with the ggplot2 package generate numerous grid grobs and viewports which are labelled and organised into a coherent hierarchy. This report describes an example that shows how to manipulate the grobs and viewports in a ggplot2 plot using tools from the grid package, export the result to SVG using gridSVG, then manipulate the result further using XML tools, to produce an interactive ggplot2 graphic for the web.
New hook functions, makeContext() and makeContent(), have been added to the grid graphics package. These functions allow an alternative approach to developing custom grobs when a grob can only decide what to draw at drawing time rather than when the grob is created. For custom grobs that are based on this new approach, the
grid.force() function provides access to low-level grobs that are otherwise invisible because they are only generated at drawing time.
These functions lead to greater flexibility in the development of custom grobs and more power to modify the result after drawing is complete.