Is it possible to create a text box with a "Source: " left-aligned below the x-axis title? I saw the discussion for manipulating x-axis titles at https://help.plot.ly/adding-HTML-and-links-to-charts/, but that does not allow for left alignment (I tried
<div align:left> and nothing happened).
Below is an MWE of what I was able to do, but I would like my source annotation left aligned below the x-axis title
df <- data.frame(x = 1:10, y = 1:10) plot_ly(data = df, x = ~x, y = ~y, type = 'scatter', mode = 'lines') %>% layout(title = 'Sample Chart', margin = list(l = 50, r = 50, t = 60, b = 60), annotations = list(text = 'Source: U.S. Census Bureau.', font = list(size = 12), showarrow = FALSE, xref = 'paper', x = -0.03, yref = 'paper', y = -0.2))
I have also posted this question on StackOverflow, but if I get an answer here, I will be sure to update my answer there so people are not wasting their time.