I've made a function that outputs a graph. I can add an annotation to it just fine, but if I try to add two annotations in a list (which is what the documentation tells me to do), the whole plot disappears.
Here is code that works:
a <-  list(
    x = 0,
    y = 1.05,
    text = 'Quotes',
    xref = "paper",
    yref = "paper",
    showarrow = F
  )
  
  b <-  list(
    x = 1,
    y = 1.05,
    text = 'Sales',
    xref = "paper",
    yref = "paper",
    showarrow = F
  )
function1(dt) %>% 
  layout(annotations = a)
function1(dt) %>% 
  layout(annotations = b)
But if I run the below line, the whole plot goes blank (no axes or anything):
function1(dt) %>% 
  layout(annotations = list(a,b))
Has anyone come across this problem before? Any help gratefully appreciated.
