Given this dataframe:
df <- data.frame(
fruit = c("Apple", "Banana", "Apple", "Mango", "Banana", "Apple", "Mango",
> "Orange", "Mango", "Banana", "Apple", "Banana", "Orange", "Orange",
> "Mango", "Mango", "Apple", "Orange", "Mango", "Banana", "Apple",
> "Banana", "Apple", "Mango", "Banana", "Apple", "Mango", "Orange",
> "Mango", "Banana", "Apple", "Banana", "Orange", "Orange", "Mango",
> "Mango", "Apple", "Orange", "Mango", "Banana"),
weight = c(3.85, 0.63, 1.12, 3.99, 1.76, 4.42, 1.54, 1.23, 4.73, 1.28,
1.95, 4.88, 1.15, 1.61, 2.55, 1.34, 4.07, 2.92, 1.43, 1.68,
2.30, 2.05, 2.45, 2.12, 2.75, 1.92, 2.64, 2.38, 3.88, 2.23,
2.97, 2.18, 2.36, 2.82, 3.65, 2.46, 2.19, 2.11, 2.59, 2.84)
> )
and these line of code, geom_dotplot() produces an expected plot
df$fruit <- as.factor(df$fruit)
p1 <- ggplot(df, aes(x = fruit, y = weight, fill = fruit)) +
geom_dotplot(binaxis='y', stackdir='center', binpositions = "all") +
labs(
x = "Fruit",
y = "Weight") +
ylim(0, 5)
p1
the geom_dotplot() plot is here:

however, when I convert it with plotly::ggplotly(p1), I get this image
I have tried multiple arguments in the geom_dotplot layer like adjusting arguments stackratio, dotsize, stackdir and even binwidth but the ggplotly function never produces the same chart as the one created with geom_dotplot(). Am I missing something here?
