I\'m having problems stopping the y-axis text from overlapping with the ticks using ggplotly
around ggplot
. How can I fix this? I\'ve tried the fol
Find an answer from Github that solved this problem elegantly.
layout_ggplotly <- function(gg, x = -0.02, y = -0.08){
# The 1 and 2 goes into the list that contains the options for the x and y axis labels respectively
gg[['x']][['layout']][['annotations']][[1]][['y']] <- x
gg[['x']][['layout']][['annotations']][[2]][['x']] <- y
gg
}
gp %>% layout_ggplotly