This function copy a ggplot plot and set all its geoms to 'alpha=0'/'size=0'. 'alpha=0' makes most elements invisible. 'size=0' helps with some elements not influenced by 'alpha' like bar borders. The goal is to create a plot object with just the background elements visible.
A ggplot plot
A number for 'correct_font'
NOTE: There are probably better way to do this but my attempts to remove geoms ended up in recalculated scales. See: https://stackoverflow.com/q/50434608/2008527
The function also include a call to 'correct_font()' which lets you apply a multiplier to all text elements font sizes.
A ggplot gtable
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.