Documentation for grid, grobs, gtable, etc.


I'm looking for detailed documentation on grid, grobs, gtable and similar classes. Basically, I need to work with the output of ggplot_gtable() but can't find any resources on the subject. I am mainly interested in how layouts are calculated, but it would also be nice to have a list of valid gpar values, what units are used and how drawing order is determined.

Any suggestions are greatly appreciated!

I would start here : 20 ggplot2 internals | ggplot2 (

Thanks. I made some progress in understanding how the grid package works, but there seems to be a lot of undocumented (admittedly internal) things. For example, the $widths and $heights of a gtable object refer to the rows ans columns of its grid, but what do the $widths and $heights in a gTree refer to? Can I assume that the height of a gTree is the sum of its $heights? (I'm aware of the fact that there are functions to calculate a grob's dimensions, but this is more about understanding the internals)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.