sugrrants icon indicating copy to clipboard operation
sugrrants copied to clipboard

"Dangling Monday" is plotted at top of calendar

Open nklepeis opened this issue 5 years ago • 1 comments

Hi! Wonderful Package!

I noticed what may be a small bug where if there is a "dangling monday" for a given monthly calendar it seems to be plotted at the top of the calendar instead of at the bottom. See the attached example, in which Sept 30 is at the top instead of the bottom of the calendar.

My code:

alldata %>%
filter(Time.POSIX >= as_datetime("2019-09-01 00:00:00", tz="America/Los_Angeles"),
     Time.POSIX <= as_datetime("2019-10-01 00:00:00", tz="America/Los_Angeles"), 
     Response == "PM2.5_ATM_ug.m3") %>%  
mutate(Date = as_date(Time.POSIX),
     Time = 60*hour(Time.POSIX)+minute(Time.POSIX),
     Month = month(Time.POSIX, label = TRUE)) %>%  
ggplot(aes(x = Time, y = Value, color = Location)) +
geom_line() +
scale_x_continuous(breaks=c(0,360,780,1140), 
                 labels=c("12a","6a","12p","6p"),
                 limits=c(0,1440)) + 
labs(y = "PM2.5", x = "Time", title="Purple Air") +  
facet_calendar(~ Date, ncol=2) +
 theme_bw() +
theme(legend.position = "bottom")

Everything else I have plotted looks great,

Thanks, Neil

facet_calendar_PA

nklepeis avatar Dec 01 '19 05:12 nklepeis

OK, I just read in the closed issues that there is a fixed 7*5 matrix and panels are wrapped.

nklepeis avatar Dec 02 '19 00:12 nklepeis