-
Notifications
You must be signed in to change notification settings - Fork 394
Open
Labels
mathany issue related to math support in specific formatsany issue related to math support in specific formatsplotly
Description
I'm writing a report using Jupyter notebook in VSCode and I'm enable to use math expressions in figure labels while writing math in markdown too!
The output I'm trying to generate is an HTML file.
Here is my observations:
- I need to add a MathJax library to be able to show math properly in plotly figure labels.
- This works well (labels show correctly and figure maintain interactivity) as long as I don't add math in markdown.
- Once I add math in markdown the labels disappear and figure loses interactivity.
Here is a MRE reproducing the issue:
---
format:
html:
execute: true
jupyter: python3
---
```{python}
import plotly.express as px
from IPython.display import display, HTML
display(HTML(
'<script async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script>'
))
fig = px.line(x=[0, 1, 2, 3, 4],
y=[1, 2, 4, 8, 16],
)
fig.update_layout(yaxis_title = '$2^x$',
xaxis_title = '$x$',
)
fig.show()
```
Math in Markdown:
$$x$$
Metadata
Metadata
Assignees
Labels
mathany issue related to math support in specific formatsany issue related to math support in specific formatsplotly