Open
Description
In plotly 4.10.4
a bar plot with only one date observation shows actually multiple ticks when the ticks' format is converted. Here a minimal reproducible example:
library(dplyr)
library(plotly)
df <- tibble(Time = "2025-01", Animal = "Monkey", value = 2)
df %>%
plot_ly(x = ~Time, y= ~value, color = ~Animal) %>%
layout(
xaxis = list(
type = "date",
tickformat = "%b '%y"
)
)
This is not the case though for a stacked bar plot:
df <- tibble(Time = c("2025-01", "2025-01"), Animal = c("Monkey", "Lion"), value = c(2, 3))
df %>%
plot_ly(x = ~Time, y= ~value, color = ~Animal) %>%
layout(
barmode = "stacked",
xaxis = list(
type = "date",
tickformat = "%b '%y"
)
)
When looking at the dates without formatting one can see a few minimal shifts around the actual date:
df <- tibble(Time = "2025-01", Animal = "Monkey", value = 2)
df %>%
plot_ly(x = ~Time, y= ~value, color = ~Animal) %>%
layout(
xaxis = list(
type = "date"
)
)
Is this already somewhere addressed?
Metadata
Metadata
Assignees
Labels
No labels