plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

write_html is not rendering Latex

Open dwerner95 opened this issue 3 years ago • 2 comments

The following example produces two figures, one rendered in the browser using fig.show()displays the latex text correct. The other one using fig.write_html does not render latex.

import plotly.express as px
df = px.data.tips()
fig = px.histogram(df, x="total_bill")
fig.update_layout(
      yaxis=dict(
                title= r"$\Huge{\text{test}}$",
                side="left",
                )
)
fig.show()
fig.write_html("test.html")

dwerner95 avatar Sep 08 '21 09:09 dwerner95

You'll need to use the include_mathjax argument to write_html() for this to work.

nicolaskruchten avatar Sep 08 '21 12:09 nicolaskruchten

It works fine pythonfig.write_html(..., include_mathjax="cdn")

Ipuch avatar Jul 27 '22 19:07 Ipuch