I am aware that one is able to annotate a plot created by ggplot2 or even to combine large and small viewports, as is documented in the ggplot2-book. However, it seems that these only work in the actual plot-areas and not in the "final plot".
For example I have a plot like this:
Here we see ten panels showing a linear regression smoother applied to a binomial dataset, but that´s not the point. Now I want a summary (stored in a dataframe) in form of a text in the lower right of the plot, such as this...
I did not find any example that comes even close. Any hints, helps or comments are much appreciated!
Rather late to the game, but I haven't seen any solution that extends to multiple empty facet spaces, so here goes.
Step 0. Sample ggplot with 2 unfilled facets, using the inbuilt diamonds dataset:
Step 1. Convert plot to gtable using
ggplotGrob
Step 2. (Optional) Get the cell coordinates of the unfilled cells to be used for textbox. You can skip this if you prefer to read off the layout above. In this case the top-left cell would be (16, 8) and the bottom-right cell would be (18, 12).
Step 3. Overlay textbox as a tableGrob
Demonstrating some variations:
Since ggplot2 2.2, I've used the caption option instead. You might want to give that a try.
And here's what you'd get:
I hope that helps you.