plotly.py
plotly.py copied to clipboard
Latex plot titles are not rendered in VS Code
Hi,
I try to rename my plot axis using latex titles, they are not rendered in my VS Code jupyter notebook, nor in an exported html using include_mathjax = 'cdn'.
fig = go.Figure(
data=go.Scatter3d(x = [1,2,3],y=[2,3,1],z=[1,3,3]))
fig.update_layout(scene = dict(xaxis_title = r"$\lambda$"))
fig.show()
gives me:
The same expression in a markdown cell works:
$\lambda$
Using maplotlib works, as well.
I tried a workaround posted in #1740 using:
from IPython.display import display,HTML
display(HTML("""
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=config=TeX-AMS-MML_SVG">
</script>
"""))
without success.
Any help is appreciated!
I'm having the same issue, with the latest versions of Plotly and vscode stable
I want to confirm that this doesn't work for 2-D plots either. However, when writing the figure as a PNG, it renders correctly.
People have had the same issue due to running on different browsers, so it sounds like it's a rendering issue to do with how VS Code displays notebooks.
Given that VS Code is probably the most popular IDE, it would be nice if plotly did something to support it.
Note that this is also an issue in Google Chrome and Firefox, which are also quite popular browsers.
Can confirm the problem persist, but it could be vscode related not plotly..
I confirm the problem persist, I agree with @herbzhao
I have the same problem.
Visual Studio Code Version: 1.69.2 (Universal) Commit: 3b889b090b5ad5793f524b5d1d39fda662b96a2a Date: 2022-07-18T16:12:57.074Z (3 wks ago) Electron: 18.3.5 Chromium: 100.0.4896.160 Node.js: 16.13.2 V8: 10.0.139.17-electron.0 OS: Darwin x64 21.5.0
Plotly version: 4.14.3
I'm having the same issue as well. My specs are:
Version: 1.72.2 (Universal) Commit: d045a5eda657f4d7b676dedbfa7aab8207f8a075 Date: 2022-10-12T22:16:30.254Z Electron: 19.0.17 Chromium: 102.0.5005.167 Node.js: 16.14.2 V8: 10.2.154.15-electron.0 OS: Darwin arm64 21.4.0 Sandboxed: No
Plotly version: 5.10.0
Also having this problem on VSCode, LATEX does render fine on Jupyter notebook (firefox) with the same interpreter though.