Skip to content

Commit c5f09ef

Browse files
committed
Fixed the wrong layering of the ggplots.
1 parent e1cbd56 commit c5f09ef

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

vignettes/advanced.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,14 +369,14 @@ fc <- bind_rows(k_week_ahead(x, ahead = 7, as_of = TRUE),
369369
# Plot them, on top of latest COVID-19 case rates
370370
ggplot(fc, aes(x = target_date, group = time_value, fill = as_of)) +
371371
geom_ribbon(aes(ymin = fc_lower, ymax = fc_upper), alpha = 0.4) +
372+
geom_line(data = x_latest, aes(x = time_value, y = case_rate),
373+
inherit.aes = FALSE, color = "gray50") +
372374
geom_line(aes(y = fc_point)) + geom_point(aes(y = fc_point), size = 0.5) +
373375
geom_vline(aes(xintercept = time_value), linetype = 2, alpha = 0.5) +
374376
facet_grid(vars(geo_value), vars(as_of), scales = "free") +
375377
scale_x_date(minor_breaks = "month", date_labels = "%b %y") +
376378
labs(x = "Date", y = "Reported COVID-19 case rates") +
377-
theme(legend.position = "none") +
378-
geom_line(data = x_latest, aes(x = time_value, y = case_rate),
379-
inherit.aes = FALSE, color = "gray50")
379+
theme(legend.position = "none")
380380
```
381381

382382
We can see that these forecasts, which come from training an ARX model jointly

vignettes/archive.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,14 +377,14 @@ fc <- bind_rows(k_week_ahead(x, ahead = 7, as_of = TRUE),
377377
# Plot them, on top of latest COVID-19 case rates
378378
ggplot(fc, aes(x = target_date, group = time_value, fill = as_of)) +
379379
geom_ribbon(aes(ymin = fc_lower, ymax = fc_upper), alpha = 0.4) +
380+
geom_line(data = x_latest, aes(x = time_value, y = case_rate),
381+
inherit.aes = FALSE, color = "gray50") +
380382
geom_line(aes(y = fc_point)) + geom_point(aes(y = fc_point), size = 0.5) +
381383
geom_vline(aes(xintercept = time_value), linetype = 2, alpha = 0.5) +
382384
facet_grid(vars(geo_value), vars(as_of), scales = "free") +
383385
scale_x_date(minor_breaks = "month", date_labels = "%b %y") +
384386
labs(x = "Date", y = "Reported COVID-19 case rates") +
385-
theme(legend.position = "none") +
386-
geom_line(data = x_latest, aes(x = time_value, y = case_rate),
387-
inherit.aes = FALSE, color = "gray50")
387+
theme(legend.position = "none")
388388
```
389389

390390
Each row displays the forecasts for a different location (CA and FL), and each

0 commit comments

Comments
 (0)