Hi everyone !
As in this subject : ggplotly adjust label position, I wanted to "push" the y axis title away from the y-axis on my graph. And the solution given there worked great for a while until I had to facet_grid my plot with 2 variables. When I do so, the title is centered on one of the facetted plot (the top one) like so :
With the example given in the post metionned previously :
library(dplyr)
library(ggplot2)
library(plotly)
iris %>%
ggplot(aes(x=Sepal.Length, y=Sepal.Width)) +
geom_point() +
labs(
x = NULL,
y = NULL
)+
theme(text=element_text(size=24)) +
facet_grid(vars(Species)) -> g
ggplotly(g) %>%
layout(margin=list(l=300, r=100, b=100, t=100),
yaxis=list(
title=list(text = "Sepal width", standoff=50)
))
I looked through this page (Layout.yaxis in R) to see if there were an argument or something that could be helpful but I did not manage to make anything work...