Open stephteo opened 3 years ago
Thanks for the bug. Related issue #7801
re-opening this since it has a good explanation of the remaining issue - that latex doesn't render within plotly widgets
Hi all, I have the same issue, but seeing exactly the same using Jupyter Lab as well. Did a little bit of digging, and found this plotly issue: https://github.com/plotly/plotly.py/issues/515
Based on the discussion there, I've put together this workaround, that seems to work in VSCode as well:
import plotly
from IPython.display import display, HTML
plotly.offline.init_notebook_mode()
display(HTML(
'<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_SVG"></script>'
))
@tomas-mazak Thanks for the workaround!
Would be great if this issue could be revisited so plotly LaTeX labels in VS Code work out of the box. Thanks!
This fix the title but removes the rest of the labels for me.
Environment data
Expected behaviour
Successfully have LaTeX render in Plotly figures when running on either Jupyter Notebook or JupyterLab from a Chrome browser (Version 95.0.4638.54). Tested this with the examples directly from Plotly: https://plotly.com/python/LaTeX/
Note: Using Chrome because there is a bug in Firefox that prevents proper rendering of Plotly figures with Mathjax (https://github.com/plotly/plotly.js/pull/5993)
It looks like this may be related to this issue: https://github.com/microsoft/vscode-jupyter/issues/6802 since you can wrap the above figure in Plotly FigureWidget:
Actual behaviour
No LaTeX rendering when using the same Jupyter notebook in VS Code.
Steps to reproduce:
Simply run any of the above code in VS Code with the same environment as listed above.