plotly.py
plotly.py copied to clipboard
Legend with latex displays wrong in jupyter lab
I need to use latex notation in legend of the plot, but it works wrong (at least in jupyter lab). For example:
import plotly.graph_objects as go
fig = go.Figure()
fig.add_trace(go.Scatter(
x=[1, 2, 3, 4, 5],
y=[1, 2, 3, 4, 5],
name="$hello$"
))
fig.add_trace(go.Scatter(
x=[1, 2, 3, 4, 5],
y=[5, 4, 3, 2, 1],
name="$world$"
))
fig.show()
Will show something like this:

As you can see, the legend is cropped on the right. Is it any way to fix it?