View source: R/finalise_newsroom2.R
finalise_newsroom2 | R Documentation |
Tweaks the margins and adjusts for fisheye distortion to suit newsroom camera 2. The parameters have been set by trial and error
finalise_newsroom2(plot, save_filepath, ...)
plot |
the plot to output |
save_filepath |
where to save it. |
... |
other arguments passed through to [finalise_tv()] |
library(bbplot2)
library(ggplot2)
plot <- ggplot(uk_gdp, aes(x = date, y = value)) +
geom_line(colour = tvcols["news"], lineend = "round", linewidth = 1.2) +
labs(
title = "Quarterly UK GDP",
caption = "Source: Office for National Statistics"
) +
plasma_style() +
scale_y_continuous(
label = scales::label_dollar(
prefix = "£",
scale_cut = c(" " = 0, "bn" = 1e3, "tn" = 1e6)
)
) +
annotate("label", lubridate::ymd("1980-01-01"),
450000,
label = "The eighties"
)
finalise_newsroom2(plot, "fisheye_plot.png")
## delete files with base::unlink()
unlink("fisheye_plot.png")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.