3d scatter plot using plotly offline - not displaying latex axis labels

Hello, I am using scatter_3d to produce a 3D scatter plot. I am trying to use latex-style for the axis labels. I am using include_mathjax='cdn' but the output does not have correctly rendered axis labels.

Is this a bug or can I do something to correct this?

Here is some sample code:

import numpy as np
import pandas as pd
import plotly.express as px
import plotly


df1 = pd.DataFrame(data={'V1': np.array([1, 2, 3, 4, 5]),
                     'V2': np.array([6, 7, 8, 9, 10]),
                     'V3': np.array([11, 12, 13, 14, 15])
                     })

fig = px.scatter_3d(df1, x='V1', y='V2', z='V3',
                    opacity=1, 
                    title='A test',
                    labels={'V1': r'$A_1$',
                            'V2': r'$A_2$',
                            'V3': r'$A_3$',
                            })

fig.update_layout(margin=dict(l=0, r=0, b=0, t=30),template='plotly_dark', title='Teeest', showlegend=True)

plotly.offline.plot(fig, filename = 'example3D_bug.html', include_mathjax='cdn', auto_open=False)

fig.show()

1 Like