We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ ]
VS Code version: 1.85.1
Jupyter Extension version (available under the Extensions sidebar): v2023.11.1003402403
Python Extension version (available under the Extensions sidebar): v2023.22.1
OS (Windows | Mac | Linux distro) and version: WIndows 11 23H2
Python and/or Anaconda version: 3.12.0
Plotly version: 5.18.0
According to the example in the official Plotly :https://plotly.com/python/LaTeX/, the result should look like this:
import plotly.express as px fig = px.line(x=[1, 2, 3, 4], y=[1, 4, 9, 16], title=r'$\alpha_{1c} = 352 \pm 11 \text{ km s}^{-1}$') fig.update_layout( xaxis_title=r'$\sqrt{(n_\text{c}(t|{T_\text{early}}))}$', yaxis_title=r'$d, r \text{ (solar radius)}$' ) fig.show()
In fact when I ran the code in a py file, it did have the desired effect in Chrome.
But when I use notebook in VScode it renders as follows:
I found that even though he doesn't render properly, he still outputs normal images when I use the code fig.write_image("test.png"):
fig.write_image("test.png")
Based on the #8131 , I found that just adding a line of code at the beginning renders it properly:
import plotly.express as px from IPython.display import display, HTML 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>' )) fig = px.line(x=[1, 2, 3, 4], y=[1, 4, 9, 16], title=r'$\alpha_{1c} = `352` \pm 11 \text{ km s}^{-1}$') fig.update_layout( xaxis_title=r'$\sqrt{(n_\text{c}(t|{T_\text{early}}))}$', yaxis_title=r'$d, r \text{ (solar radius)}$' ) fig.show()
On this basis, even if I change this line of code to a comment, he still works and renders the picture(even if clicking reboot kernel):
But if at this point I close the file and reopen it, he'll fail to render it correctly again:
Simply run this code in a VScode notebook.
12:16:18.302 [info] Handle Execution of Cells 0 for e:\<username>\Desktop\test\tets.ipynb 12:16:18.308 [info] Kernel acknowledged execution of cell 0 @ 1703304978307 12:16:18.461 [info] End cell 0 execution after 0.154s, completed @ 1703304978461, started @ 1703304978307
The text was updated successfully, but these errors were encountered:
duplicate of #8131
Sorry, something went wrong.
amunger
No branches or pull requests
Environment data
[ ]
VS Code version: 1.85.1
Jupyter Extension version (available under the Extensions sidebar): v2023.11.1003402403
Python Extension version (available under the Extensions sidebar): v2023.22.1
OS (Windows | Mac | Linux distro) and version: WIndows 11 23H2
Python and/or Anaconda version: 3.12.0
Plotly version: 5.18.0
Expected behaviour
According to the example in the official Plotly :https://plotly.com/python/LaTeX/, the result should look like this:
In fact when I ran the code in a py file, it did have the desired effect in Chrome.
Actual behaviour
But when I use notebook in VScode it renders as follows:
I found that even though he doesn't render properly, he still outputs normal images when I use the code
fig.write_image("test.png")
:Based on the #8131 , I found that just adding a line of code at the beginning renders it properly:
On this basis, even if I change this line of code to a comment, he still works and renders the picture(even if clicking reboot kernel):
But if at this point I close the file and reopen it, he'll fail to render it correctly again:
Steps to reproduce:
Simply run this code in a VScode notebook.
Logs
The text was updated successfully, but these errors were encountered: