Say you have the following df:
x <- as.Date(c(\"1963-06-01\", \"1964-06-01\", \"1965-06-01\",\"1966-06-01\"))
y <- c(1162.7, 975.4, 1280.3, 1380.0)
data&l
This appears to be a problem in Mac and seems to be related with the way geom_bar handles dates.
I found that adding as.POSIXct()
fixes the issue.
x <- c("1963-06-01", "1964-06-01", "1965-06-01","1966-06-01")
y <- c(1162.7, 975.4, 1280.3, 1380.0)
data<- data.frame(x, y)
ggplotly(ggplot(data=data) +
geom_bar(aes(x = as.POSIXct(x), y = y), stat = "identity"))