0

Im having problems when I transform a ggplot plot to a plotly object in the geom_ribbon. [this is what I get after using ggplotly][1]

This is what i want to get after using ggplotly

Here is my code:

  geom_line(aes(y=fitted),linetype=2,size=1) +
  geom_ribbon(aes(ymin=lower,ymax=upper,alpha=0.25)) +
  geom_point(aes(color=anom,size=anom,text = paste("Fecha:", sup, "\nNúmero de carpetas:", delitos))) +
  scale_size_discrete(range=c(1,3)) +
  scale_color_manual(values=c("royalblue","red")) +
  scale_x_date(date_breaks = "1 week") +
  labs(title=aux_titulo,y="Carpetas de investigación") +
  theme_bw() +
  theme(plot.title=element_text(hjust=0.5,face="bold"),
        axis.title.y = element_text(face="bold"),
        axis.title.x = element_blank(),
        legend.position = "none",
        legend.title = element_blank(),
        legend.text = element_text(face="bold"),
        axis.text = element_text(face="bold"),
        axis.text.x = element_text(angle=90,hjust=1,vjust=0.5))


g <- ggplotly(plot_aux,tooltip = c("text"))  %>% config(displayModeBar = F) %>% layout(xaxis=list(fixedrange=TRUE)) %>% layout(yaxis=list(fixedrange=TRUE),legend = list(
  orientation = "h",x = 0.3, y =-0.3))
g```

1 Answers1

0

[this is what I get when I use ggplotly1