I am trying to remove the legend title using ggplotly without success. I'm sure there is an easy fix, but I cannot find the documentation for it - and removing the legend title (or changing the positioning) using ggplot fails to work. See e.g.:
# Creating the ggplot:
a <- ggplot(mtcars, aes(x = interaction(cyl, carb, lex.order = T),
y = mpg,fill = interaction(cyl, carb, lex.order = T))) +
geom_boxplot() + theme(legend.title=element_blank())
a # No Legend Title
# plotly puts back the legend title
ggplotly(a)
Any ideas how to change / remove the title of the graph? Should it be done using ggplotly or ggplot?
You can use the
labs
function: