In this example, I assume you have formatted the string using $$. When I run this example, if I use the same syntax the annotation is not displayed. If I remove the $$ the annotation is displayed but in a rather basic format.
What are the $ format and why it is not working?
I do not know why you are not seeing the same annotation as the example. However, the $ symbols are there to tell plotly that you are using a LaTeX typesetting for the string you are creating.
When I look at your example, the text in the hovering looks like this:
Is it what is expected?
You may want to keep an eye on https://github.com/plotly/plotly.py/issues/515, it looks like there are several issues cropping up with latex typesetting in various contexts.