plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

Latex axes label issue

Open guenp opened this issue 12 years ago • 23 comments

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

guenp avatar Aug 13 '14 15:08 guenp

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

chriddyp avatar Aug 13 '14 15:08 chriddyp

Any ETA on this? Thanks.

benvarkey avatar Dec 22 '15 03:12 benvarkey

@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.

chriddyp avatar Dec 22 '15 05:12 chriddyp

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

benvarkey avatar Dec 22 '15 08:12 benvarkey

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.

benvarkey avatar Dec 23 '15 08:12 benvarkey

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

stephf0716 avatar Jan 11 '16 06:01 stephf0716

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.

rethore avatar Feb 11 '16 09:02 rethore

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

nvenayak avatar Jun 07 '16 22:06 nvenayak

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

Kully avatar Aug 10 '16 13:08 Kully

I would also love using Latex in plotly offline mode!

MaryAnnEbeling avatar Jan 31 '17 10:01 MaryAnnEbeling

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

flo-compbio avatar Feb 02 '17 16:02 flo-compbio

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

guenp avatar Feb 02 '17 16:02 guenp

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

chriddyp avatar Feb 02 '17 17:02 chriddyp

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

iliyang avatar Jun 16 '17 16:06 iliyang

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

ktran9891 avatar Jun 30 '17 22:06 ktran9891

Same here :) +1 for fix request

KseniiaPalin avatar Sep 18 '17 08:09 KseniiaPalin

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

June-Skeeter avatar Dec 13 '17 13:12 June-Skeeter

@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

SebastianSchmidl avatar Dec 13 '17 13:12 SebastianSchmidl

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.

June-Skeeter avatar Dec 13 '17 13:12 June-Skeeter

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

SebastianSchmidl avatar Dec 14 '17 18:12 SebastianSchmidl