-
Notifications
You must be signed in to change notification settings - Fork 334
Open
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug
Description
Environment data
- VS Code version: 1.61.2
- Jupyter Extension version (available under the Extensions sidebar): v2021.9.1101343141
- Python Extension version (available under the Extensions sidebar): v2021.10.1365161279
- OS (Windows | Mac | Linux distro) and version: Mac Big Sur Version 11.6
- Python and/or Anaconda version: Python 3.9.7
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): XXX
- Jupyter server running: Tried both Local and Remote
- Plotly version: 4.14.3
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/
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()
import plotly.graph_objs as go
fig = go.Figure()
fig.add_trace(go.Scatter(
x=[1, 2, 3, 4],
y=[1, 4, 9, 16],
name=r'$\alpha_{1c} = 352 \pm 11 \text{ km s}^{-1}$'
))
fig.add_trace(go.Scatter(
x=[1, 2, 3, 4],
y=[0.5, 2, 4.5, 8],
name=r'$\beta_{1c} = 25 \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()
Note: Using Chrome because there is a bug in Firefox that prevents proper rendering of Plotly figures with Mathjax (plotly/plotly.js#5993)
It looks like this may be related to this issue: #6802 since you can wrap the above figure in Plotly FigureWidget:
f = go.FigureWidget(fig)
f.show()
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.
b-a0, tomas-mazak, geronimos, UtkarshVerma, janosh and 4 more
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug