Skip to contents

Given a tibble of data properly formatted for a hubverse schema forecast hub submission, plot a timeseries quantile predictions for a given location.

Usage

plot_hubverse_quantiles_loc(
  location,
  forecast_data,
  truth_data,
  location_format = "abbr",
  ytrans = "log10",
  linesize = 2,
  pointsize = 4,
  forecast_linecolor = "darkblue",
  forecast_pointcolor = "darkblue",
  truth_linecolor = "black",
  truth_pointcolor = "black",
  target_name = NULL,
  autotitle = TRUE
)

Arguments

location

location to plot

forecast_data

hubverse format quantile forecast data, as a tibble.

truth_data

hubverse format truth data, as a tibble.

location_format

format of the provided location. Permitted formats are "abbr" (state/territory or nation two letter USPS abbreviation), "hub" ( legacy 2-digit FIPS code for states and territories, US for the USA as a whole), and "long_name" (full English jurisdiction names; not recommended). Default "abbr".

ytrans

axis transform passed to ggplot2::scale_y_continuous(). Default 'log10'.

linesize

size parameter passed to ggplot2::geom_line(). Default 2.

pointsize

size parameter passed to ggplot2::geom_point(). Default 4.

forecast_linecolor

color parameter passed to ggplot2::geom_line() for plotting forecasts. Default "darkblue".

forecast_pointcolor

color parameter passed to ggplot2::geom_point() for plotting forecasts. Default "darkblue".

truth_linecolor

color parameter passed to ggplot2::geom_line() for plotting truth data. Default "black".

truth_pointcolor

color parameter passed to ggplot2::geom_point() for plotting truth data. Default "black".

target_name

Name of the forecast target, for labeling the plot y-axis. Default NULL, in which case a value from the target column in forecast_data will be used.

autotitle

Boolean. Generate an automatic title for the plot from the location name and reference date? Default TRUE.

Value

the plot as a ggplot object