How would I add the Y axis title "Thousands of People" to cover the entire figure, and not for a single subplot row? The image below shows the y-axis title scrunched at the bottom if the plot. I'm wanting a single y-axis label, oriented in the middle of the overall chart, not the middle of the subplot-row. BONUS: keep the y axis title orientation while allowing the layout(autosize = TRUE).
library(plotly)
plotList <- function(nplots) {
lapply(seq_len(nplots), function(x) {
plot_ly(economics, x = ~date, y = ~unemploy)%>%
add_annotations(
text = ~paste("Plot ",x),
x = 0.5,
y = 1.1,
yref = "paper",
xref = "paper",
xanchor = "middle",
yanchor = "top",
showarrow = FALSE)
}
)
}
s1 <- subplot(plotList(4), nrows = 4, shareX = TRUE, shareY = TRUE, titleY = FALSE, margin = .01)
s2 <- subplot(plotList(2), shareY = TRUE)
fig <- subplot(s1, s2,
plot_ly(economics, x = ~date, y = ~unemploy)%>%
layout(yaxis = list(title = 'Total Unemployed Persons')),
nrows = 3,
margin = 0.04, heights = c(0.6, 0.3, 0.1),
titleY = TRUE)
fig
DESIRED CHART: These links may help anyone trying to answer: r plotly community, and python plotly community