Adds an image to a ggplot object. This allows the use of package internal
logos associated with Mazama Science and the USFS AirFire group specified
with brandStyle and brandName. User provided images can be
specified by using brandFilePath.
ggplot object
"logo" or "icon".
Name of brand: "MazamaScience", "USFS", or
"AirFire".
Path to brand logo or icon. If not NULL,
overrides brandStyle and brandName.
String indicating the location where the logo should be
printed. Options are: "topright", "topleft",
"bottomright", or "bottomleft".
Brand icon or logo width, in fraction of plot width.
A gTree object, which can be printed with grid.draw().
library(AirMonitorPlots)
monitor <- AirMonitor::Carmel_Valley
mts_tidy <- monitor_toTidy(monitor)
gg <-
ggplot_pm25Timeseries(mts_tidy) +
stat_dailyAQCategory(adjustylim = TRUE)
#> Warning: The `size` argument of `element_line()` is deprecated as of ggplot2 3.4.0.
#> ℹ Please use the `linewidth` argument instead.
#> ℹ The deprecated feature was likely used in the AirMonitorPlots package.
#> Please report the issue at
#> <https://github.com/MazamaScience/AirMonitorPlots/issues>.
brandPlot(gg, location = "topright", size = .2)
#> NULL
brandPlot(gg, location = "bottomright", brandName = "USFS")
#> NULL
brandPlot(gg, brandName = "AirFire", location = "topleft", size = .15)
#> NULL