Latex (math mode) in Bokeh

Hi, all

Is there any chance I can use the math mode (text code) in Bokeh? I checked all the git issues (and possible options to solve) but nothing seems to work in my case :frowning:

Let’s say I have \alpha_\beta (so alpha_beta) in my dataset (.csv) and I want to include It in a plot or hover - how would I do that? Sure I can use alpha symbol but how would I make beta be a subscript of alpha?

Thank you in advance!

Mathtext was part of the recent CZI Grant that Bokeh received. But that work is only just starting and results will not start landing until later this year.

In the mean time, mathtext an only be added by creating a custom extension. It is not completely trivial, but there is an example you can start from here:

bokeh/latex_extension.py at branch-2.4 · bokeh/bokeh · GitHub

Lastly, as a courtesy to the maintainers: since you have cross-posted this question in several places, please take it upon yourself to make sure that the above answer is given in all of those locations.

1 Like

thanks, @Bryan

I think I asked here, on the git issue and on stack overflow. I will make sure to answer there as well.
Best,
niko

2 Likes