I need to position some custom text on my charts. These notes aren’t tied to a specific trace or point, but to the chart as a whole. These may, for example, need to be positioned in the upper right and bottom left of the entire chart.
After scouring the docs, I found the paper-relative annotation positioning options. However, these positions (0, 0.5, 1, etc.) are all relative to the central plot area, and don’t take the size of the legend, axis labels, axis titles, etc. into account.
This makes it hard (impossible?) to reliably position text on the chart as a whole, since the size of the legend, axis labels, etc. is not constant. I can manually tweak the numbers for a specific known chart (e.g. make the annotation x/y values things like 1.09 or -.06, etc.), but this isn’t an option for me since we have arbitrary sets of dynamically generated charts.
Is there some trick to positioning things which take into account the variable sizes of things beyond the plot area? Or, if not, is there some trick to determining the relative size of the entire chart vs. the plot area, which can be used to dynamically adjust the positions of paper annotations?