cat_plot_code <- function(p) {
if (!inherits(p, "ggplot"))
stop("input must be a ggplot2 object")
cat(
paste0(get_plot_code(p), collapse = " +\n ")
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.