Hello,
I have created a chart in R with ggplot2 and added interactivity with ggplotly.
I have modified the scale of the axis, and it is displayed properly in my R Studio, but there is a problem in plotly, because it is displaying the old version and not applying the transformation in the scale. Someone knows how to fix it?
FP_WM_only <- ggplot(aes(x = Pop, y = Death), data = wm_funnelplot) +
geom_point(shape = 1, aes(text = paste(LA,"<br>","Avoidable death rate: ",(Death*100000))), size = 2) +
geom_line(aes(x = pop.seq, y = ll95, color = "steelblue3"), data = CI, color = "steelblue3") +
geom_line(aes(x = pop.seq, y = ul95, color = "steelblue3"), data = CI, color = "steelblue3")+
geom_line(aes(x = pop.seq, y = ll999, color = "steelblue1"), linetype = "dashed", data = CI, color = "steelblue1") +
geom_line(aes(x = pop.seq, y = ul999, color = "steelblue1"), linetype = "dashed", data = CI, color = "steelblue1") +
geom_hline(aes(yintercept = death.fem, color = “olivedrab”), data = CI, color = “olivedrab”) +
xlim(0,1150000) + scale_y_continuous(labels = function(y) y*100000) + labs(title = “Avoidable deaths in the West Midlands”, x = “Local authority population size”, y = “Avoidable deaths per 100,000\n\n”)
This is the chart in R
and this is how it is displayed. The x and y axis are not properly formatted.
https://plot.ly/~CarmenAguilar/1/
Thanks!