I love PlotlyJS interactivity mainly in Jupyter notebook or VS Code Plot pane, on the other hand, I had always problems with latex in labels.
Recently, I noticed that in one of my julia environment (Julia 1.3.1, jupyter 2.0.0, plotly extension) the LaTeX rendering in Jupyter notebook just works
using Plots, LaTeXStrings
font = Plots.font("arial", 12)
plotlyjs(guidefont=font, xtickfont=font,
ytickfont=font, legendfont=font, lw = 2, size=(600,400));
p = plot(rand(10))
p = xlabel!("\$\\alpha \\, F_\\mathrm{test}\$")
p = ylabel!(L"\Gamma^2")
plot(p)
but
savefig("test.pdf")
gave errors IOError(Base.IOError("connect: connection refused (ECONNREFUSED)", -111) during request(http://localhost:7982))
and empty file.
I can save it only as an HTML, but in the web browser, the LaTeX formulas were not rendered. The same ouput I got in VS Code plot pane.
I followed the plotly.js readme and now I have plotly figure with correct LaTeX rendering.
Original HTML HEAD was
<head>
<title>Plots.jl</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
</head>
The new HTML HEAD is
<head>
<title>Plots.jl</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script src="mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
<script>
window.PlotlyConfig = {MathJaxConfig: 'local'}
</script>
<script src="plotly.js"></script>
</head>
Here, I downloaded plotly.js
GitHub - plotly/plotly.js: Open-source JavaScript charting library behind Plotly and Dash
Any chance to get it to work out of the box?