I can not find information on ggplot2 0.9.0 documentation, 0.9.0 migration guide or search.
I assume that in earlier versions you added the tz
argument to scale_x_datetime
. I tried to place the tz
argument in different places of scale_x_datetime
, but keep getting errors. See below.
My datetime data is in POSIXct
format with GMT time zone. When I draw this, the axis ticks and breaks, showing my local time zone (EST). I would like the midnight on the axis to be midnight in the GMT time zone. What is the correct way to do this in ggplot2 0.9.0?
attributes(data$date) # $class # [1] "POSIXct" "POSIXt" # $tzone # [1] "GMT" ggplot(data, aes(x = date)) + geom_line(aes(y = count)) + scale_x_datetime(breaks = date_breaks("1 day"), labels = date_format("%d", tz = "UTC")) # Error in date_format("%d", tz = "UTC") : unused argument(s) (tz = "UTC") ggplot(data, aes(x = date)) + geom_line(aes(y = count)) + scale_x_datetime(breaks = date_breaks("1 day", tz = "UTC"), labels = date_format("%d")) # Error in date_breaks("1 day", tz = "UTC") : # unused argument(s) (tz = "UTC") ggplot(data, aes(x = date)) + geom_line(aes(y = count)) + scale_x_datetime(breaks = date_breaks("1 day"), labels = date_format("%d"), tz = "UTC") # Error in continuous_scale(aesthetics, "datetime", identity, breaks = breaks, : # unused argument(s) (tz = "UTC")
source share