Is there a way to add a data source / caption to a chart in Plotly, similar with what can be done in ggplot
with the caption argument:
labs(capt
annotation
offers a simple way to add a caption to a chart in plotly
:
library(plotly)
plot_ly(x=~hp, y=~mpg, data=mtcars, type="scatter", mode="marker") %>%
layout(annotations =
list(x = 1, y = -0.1, 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"))
)
.
More details are given here and here.