View source: R/rough_convert.R
generate_background_chart | R Documentation |
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.
generate_background_chart(p, family, font_size_booster)
p |
A ggplot plot |
font_size_booster |
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.