Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LaTeX Formatting Not Working in RootInteractive dashboard with Bokeh 3.0.2+ #350

Open
miranov25 opened this issue Jan 21, 2024 · 2 comments

Comments

@miranov25
Copy link
Owner

Issue: LaTeX Formatting Not Working in RootInteractive with Bokeh 3.3.2

Description:
After updating to Bokeh version 3.3.2, which supports LaTeX formatting, we've encountered an issue in RootInteractive where LaTeX formatted strings are not rendered correctly. It appears that the rendering mechanism in RootInteractive might not be compatible with Bokeh's new LaTeX rendering method.

Example:
When using a LaTeX formatted string for an axis title in RootInteractive, like so:

"dyCorr1.AxisTitle": r"$$\deta_{y1}$$ (cm)"

Possible Cause:

It seems there might be a need for an update or modification in RootInteractive to align with Bokeh's updated LaTeX rendering capabilities.

Request:

Guidance or suggestions on how to resolve this issue would be very helpful. If there are any known workarounds or planned updates to address this compatibility issue, please let us know.

@miranov25
Copy link
Owner Author

miranov25 commented Jan 21, 2024

Example plot from Bokeh tutorial is working well:

https://docs.bokeh.org/en/3.0.2/docs/user_guide/styling/mathtext.html
`` Bokeh uses the MathJax library to handle LaTeX and MathML. See the official MathJax documentation for more information on MathJax.''

from numpy import arange, pi, sin

from bokeh.models.annotations.labels import Label
from bokeh.plotting import figure, show

x = arange(-2*pi, 2*pi, 0.1)
y = sin(x)

p = figure(height=250, title=r"\[\sin(x)\text{ for }x\text{ between }-2\pi\text{ and }2\pi\]")
p.circle(x, y, alpha=0.6, size=7)

label = Label(
    text="$$y = \sin(x)\$$",
    x=150, y=130,
    x_units="screen", y_units="screen",
)
p.add_layout(label)

p.yaxis.axis_label = r"\[\sin(x)\]"
p.xaxis.axis_label = r"\[x\pi\]"

show(p)
image

@miranov25
Copy link
Owner Author

Temporary solution - adding figure with latex in first place

This issue was fixed for a moment in the template in recent pull request #351
It is not yet generic solution, therefore not yet closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant