Plotly.py: Latex axes label issue

Created on 13 Aug 2014  路  23Comments  路  Source: plotly/plotly.py

ylabel('R$_{xx,ac}$')
worked in matplotlib, didn't work in plotly

enhancement

Most helpful comment

I have the same issue in offline Jupyter notebooks. When I export the plot to the online web-ui it renders the latex label correctly.

All 23 comments

thanks for reporting! looks like we'll have to move around our latex $ around a bit

Any ETA on this? Thanks.

@benvarkey - You can combine LaTeX with plain text by using the Text keyword, i.e.: '$\\beta_{1c} = 25 \\pm 11 \\text{ km s}^{-1}$'. See more examples here: https://plot.ly/python/LaTeX/

For now, re-arranging the $ is out of scope for our matplotlib converter.

It doesn't render with plotly.offline.iplot(...) (shows the raw text), but it renders correctly if exported to plot.ly

Actually, I don't get the rendered text even with pure latex code:
screen shot 2015-12-23 at 12 37 42 am

But, when I export to plot.ly, I get this:
screen shot 2015-12-23 at 12 40 12 am

Any ideas? Thanks.

I am experiencing the same issue and can confirm this similarly occurs when using plotly offline with MATLAB.

I have the same issue in offline Jupyter notebooks. When I export the plot to the online web-ui it renders the latex label correctly.

Is there any plan to fix/implement this? LaTeX rendering is a fairly important feature when generating scientific plots.

Hey guys, someone on the Front support is wondering about an estimation for when this feature will be fixed. Any ideas?

I would also love using Latex in plotly offline mode!

Just wanted to point out to people here that inserting a JavaScript snippet into the notebook fixed the issue for me. Thanks @jjaraalm !!!

@chriddyp maybe you guys could implement this patch? :heart:

Opening a PR here to try out some different solutions: https://github.com/plotly/plotly.py/pull/683

Same problem here - LaTeX math labels don't render properly in offline mode (in a Jupyter notebook). Hope a fix is coming soon, thanks!

Adding my voice, as well: I would love for this to be fixed.

Same here :)
+1 for fix request

I'm having the same issue as well, its pretty frustrating, and its making me not want to use plotly any more.

@Wes-Skeeter have you tried using the fix mentioned by flo-compbio, see here

this fixed the problem for me, but it's just a workaround and I would also love to have a fix in _plotly_

Thanks, but unfortunately, this didn't fix it for me :/ I just want to put an overbar on some text labels, not sue why it has to be so complicated. HTML works for things like subscripts, Its frustrating I can't use it for this.

I'm using _plotly_ in offline mode and HTML is working just fine for me, MWE:

import plotly.offline as offline
from plotly.graph_objs import *

offline.init_notebook_mode(connected=True)
layout = Layout(title = '<span style="text-decoration: overline">text</span>')
fig = dict(data = [Scatter()], layout=layout)
offline.iplot(fig)

produces:
newplot

What a pity! LaTeX-Code is still not interpreted in offline plots. So I'll have to go back to Matplotlib until this is fixed.

The offline latex/MathJax issues are going to be resolved by https://github.com/plotly/plotly.js/pull/2994 and https://github.com/plotly/plotly.py/pull/1169. Follow along if you're interested!

Done in #1243 and will be released in version 3.4.0. LaTeX support requires no API changes for iplot or FigureWidget support. An additional include_mathjax argument has been added to plotly.offline.plot to specify how MathJax should be included in the resulting html file/div.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ivirshup picture ivirshup  路  3Comments

vlizanae picture vlizanae  路  4Comments

entron picture entron  路  4Comments

dhirschfeld picture dhirschfeld  路  4Comments

gv-collibris picture gv-collibris  路  4Comments