'How to add units in Mathematical style (like Latex) to a Plotly graph without eroding the rest of the label?

I want to make a graph that has something on the y-axis, and something on the x-axis where the x axis is given in metres squared. I've tried using Latex dollar signs to put it in 'equation mode' but this gets rid of the text before it.

Code snippet:

figure = go.Figure(
        layout=go.Layout(
            xaxis_title="Area ($m^2$)",
            yaxis_title="Value ($m/s$)"
        ))

When I run the above the 'Area' part of the x-axis title doesn't appear, only the m^2 units. How do I simultaneously get the title and the units in mathematical style to appear?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source