Начиная с сообщения, на которое вы ссылаетесь, вам нужно установить margin
в plot_ly
layout
, а затем изменить x
и y
в annotations
library(plotly)
plot_ly(x=~hp, y=~mpg, data=mtcars, type="scatter", mode="marker") %>%
layout(margin = list(b=160), ##bottom margin in pixels
annotations =
list(x = 0.5, y = -0.75, #position of text adjust as needed
text = "Source: data I found somewhere.",
showarrow = F, xref='paper', yref='paper',
xanchor='right', yanchor='auto', xshift=0, yshift=0,
font=list(size=15, color="red"))
)