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

Latex doesn't render in 3d axis titles

Open yankev opened this issue 8 years ago • 12 comments

It only appears to render in the legend. Demo: https://jsfiddle.net/60eqc0xz/7/

yankev avatar Jun 06 '16 21:06 yankev

A known limitation of using WebGL for 3D plots.

Won't be fixed any time soon.

etpinard avatar Jun 06 '16 22:06 etpinard

This is still not fixed? It has been 2 years. Kindly plan to support.

parthi2929 avatar Oct 25 '18 09:10 parthi2929

Has there been any updates on this feature?

yaozhewei avatar Jan 23 '19 06:01 yaozhewei

It's really unfortunate that 3d plot does not support latex renderig. For the mean time, is it possible to use unicode/html entity in place of latex like instead of giving $\rho$, can't we just give ρ or ρ

Koushikphy avatar Jun 25 '19 21:06 Koushikphy

Well it works if directly putting rho from copy pasting it somewhere like ρ

Koushikphy avatar Jun 26 '19 06:06 Koushikphy

I would like to have this feature and I can contribute so it is done. Is it very hard to do? What are the problems encountered? If anyone has looked at this, can you give me an overview or point me to the place to look at so I can check if I am able to help?

Catarina-Alves avatar Mar 19 '20 00:03 Catarina-Alves

@Catarina-Alves thanks very much! For rendering text using webgl @mikolalysenko's vectorize-text is called .

I think if one converts Latex to pixel data, then it could be used here https://github.com/mikolalysenko/vectorize-text/blob/18c472de123e7ea7ea25ec80b7ac15b2ea0540c4/lib/vtext.js#L310. But I may be wrong.

cc: @antoinerg @alexcjohnson

archmoj avatar Mar 19 '20 00:03 archmoj

Thank you @archmoj. I will have a look at your resources and the code and see if it is within my knowledge to make the necessary changes.

Catarina-Alves avatar Mar 19 '20 00:03 Catarina-Alves

@Catarina-Alves, any chances you would have come up with a solution?

christian-nils avatar Mar 31 '20 07:03 christian-nils

I have looked through this but I do not have the right skills to solve this issue. I am sorry.

Catarina-Alves avatar Apr 19 '20 18:04 Catarina-Alves

This issue has been tagged with NEEDS SPON$OR

A community PR for this feature would certainly be welcome, but our experience is deeper features like this are difficult to complete without the Plotly maintainers leading the effort.

What Sponsorship includes:

  • Completion of this feature to the Sponsor's satisfaction, in a manner coherent with the rest of the Plotly.js library and API
  • Tests for this feature
  • Long-term support (continued support of this feature in the latest version of Plotly.js)
  • Documentation at plotly.com/javascript
  • Possibility of integrating this feature with Plotly Graphing Libraries (Python, R, F#, Julia, MATLAB, etc)
  • Possibility of integrating this feature with Dash
  • Feature announcement on community.plotly.com with shout out to Sponsor (or can remain anonymous)
  • Gratification of advancing the world's most downloaded, interactive scientific graphing libraries (>50M downloads across supported languages)

Please include the link to this issue when contacting us to discuss.

jackparmer avatar Sep 10 '20 19:09 jackparmer

For those still interested in this issue, the crux is that 3D plots currently draw everything in WebGL, including the text. Up in https://github.com/plotly/plotly.js/issues/608#issuecomment-600920777, @archmoj proposed one way to solve this, by rasterizing the LaTeX. Another way (which is more akin to what we did with 2D WebGL plots) would be to refactor this to draw the text (ideally both titles and tick labels) in SVG instead of in WebGL. That would make it easy to support LaTeX the same way we do the rest of SVG text, and would make all of these labels higher-quality overall, particularly in vector output like PDF. Unfortunately it's a fairly major refactor, and I'm not quite sure what would be needed to pull the coordinates for all of these text items out of the stack.gl modules that handle 3D subplots and return them to our SVG drawing code.

alexcjohnson avatar Feb 10 '24 03:02 alexcjohnson