What's the reason for the added grid with plot.gtable ?
Closed this issue · 2 comments
In the function definition for plot.gtable
a grey background is added using grid.rect(...)
with a white grid on top (grid.grill(...)
) before the gtable is drawn using grid.draw()
. Is there any reason for this? It is not added by print.ggplot()
.
When I use tikzDevice
to create a stand alone pdf of a plot and include it in another document (such as knitr
does it with dev='tikz'
I sometimes see thin grey lines around my plot due to this grid. A solution for that is to simply plot the gtable with grid.draw()
directly.
The background and grid is used to help see if the gtable is correct or not. If you don't want it, don't use plot
.
Ok, I see. But if that is the only reason, would it make sense to have it as an optional argument instead, since it's used for testing and presumably not really for the final figure? It seems to me that the most natural way to plot a gtable would be with the plot function and that most users would expect that function to plot the gtable without anything added.
PDF's produced with both the pdf()
device and latex through tikzDevice
using the plot
method of gtable gives me grey lines on the left and right of the figure if I include them in another document. This does not seem like the expected behaviour when using plot()
on a gtable object.