Skip to content

Commit

Permalink
Fix gg_season() showing multiple final breaks for yearmonth()
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchelloharawild committed May 12, 2024
1 parent 6e9266e commit 51d8e27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/graphics.R
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ gg_season <- function(data, y = NULL, period = NULL, facet_period = NULL,
p <- p + scale_fn(
breaks = function(limit){
breaks <- if(suppressMessages(len <- period/ts_interval) <= 12){
ggplot2::scale_x_date()$trans$breaks(as.Date(limit), n = len)
vctrs::vec_restore(ggplot2::scale_x_date()$trans$breaks(as.Date(limit), n = len), limit)
} else{
scale_fn()$trans$breaks(limit)
}
Expand Down

0 comments on commit 51d8e27

Please sign in to comment.