I am wondering how to give difference subtitles for the subplots using plot_ly. Any hint please. I got one title BB in this case. Thanks.
p <- subplot(
plot_ly(economics, x = date, y = uempmed)%>%layout(showlegend = FALSE, title="AA"),
plot_ly(economics, x = date, y = unemploy)%>%layout(showlegend = FALSE, title="BB"),
margin = 0.05
)
I was able to use layout(annotations()) scheme not on the subplot() but on the plot_ly objects themselves. This gives a slightly better placement for dynamic visualization. So to rework @d-roy's answer:
Please note that in this case coordinates of the annotations are the same for each annotation because they are referring to each subplot and not the combined plot as a whole.
Instead of positioning "by hand" (i.e., @d-roy's answer), you can now leverage
subplot()
's ability to reposition paper referenced things like annotations (as well as shapes, images, etc).The
title
attribute in layout refers to the title for the entire plotting surface, so there can only be one. However, we can use text annotations to create "titles" for your subplots, for example: