I do have a similar behavior than Why is ggplotly ruining my legends from ggplot? but failed to fix it.
Legend is changed by ggplotly(), how could I prevent that or edit the legend?
ggplot :
Code :
library(fitdistrplus)
set.seed(123)
X <- rpois(20,3)
fit.p.mme <- fitdist(data = X, distr = "pois", method = "mme")
fit.p.mle <- fitdist(data = X, distr = "pois", method = "mle")
g1 <- cdfcomp(list(fit.p.mme, fit.p.mle), addlegend = TRUE, legendtext = c("P MME", "P MLE"), plotstyle = "ggplot")
g1 <- g1 + theme_gray()
g1
g1 %>% ggplotly()
Tryed to edit labels in g1$data$ind without success.


