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

Latex plot titles are not rendered in VS Code

Open MalteMederacke opened this issue 2 years ago • 6 comments

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:

image

The same expression in a markdown cell works:

$\lambda$

image

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!

MalteMederacke avatar Apr 01 '22 14:04 MalteMederacke

I'm having the same issue, with the latest versions of Plotly and vscode stable

IliasAarab avatar Apr 02 '22 21:04 IliasAarab

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.

Miladiouss avatar Apr 09 '22 01:04 Miladiouss

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.

theo-brown avatar Jun 22 '22 18:06 theo-brown

Can confirm the problem persist, but it could be vscode related not plotly..

mysteriousHerb avatar Jul 22 '22 13:07 mysteriousHerb

I confirm the problem persist, I agree with @herbzhao

JhianSV avatar Jul 28 '22 04:07 JhianSV

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

borondics avatar Aug 08 '22 18:08 borondics

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

ez2rok avatar Oct 26 '22 05:10 ez2rok

Also having this problem on VSCode, LATEX does render fine on Jupyter notebook (firefox) with the same interpreter though.

Philipwur avatar Dec 21 '22 09:12 Philipwur