plot_ly
已经 添加 了这个功能。现在您可以调用:
ggplotly(p) %>%
layout(
title = list(
xanchor = "right"
)
)
或
ggplotly(p) %>%
layout(
title = list(
x = 0.1
)
)
其中 x
是规范化位置,x=0
将所有内容定位到最左边,x=1
将所有内容定位到最右边。
您可以执行
ggplotly(p) %>%
add_annotations(
yref="paper",
xref="paper",
y=1.15,
x=0,
text="My Title",
showarrow=F,
font=list(size=17)
) %>%
layout(title=FALSE)