Latex label compatibility issues while using Bokeh as backend
See original GitHub issueDescribe the bug I want to use latex for my labels and so I use the following line of code.
import arviz.labels as azl
labeller = azl.MapLabeller(var_name_map={"Cxf": r"$\C_{xf}$","Cxr": r"$C_{xr}$"})
`
However, when I plot the posterior using “Bokeh” as backend using
ax_post = az.plot_posterior(idata,backend = "Bokeh",figsize = (12,8),labeller=labeller)
I get this
To Reproduce The bug can be reproduced with the attached data file and the above lines of code. https://drive.google.com/file/d/1Kld1u4VaGWYVz5Yq9GClUFaGDhFIfLhF/view?usp=sharing
Expected behavior This problem does not exist when I use matplotlib as my backend. See plots below
Additional context arviz version - 0.12.0 bokeh version - 2.4.2
Issue Analytics
- State:
- Created a year ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Support latex labels · Issue #647 · bokeh/bokeh - GitHub
I tried using LaTeX on the axis label, but it does not render. Does anyone know if there is special syntax to enable...
Read more >Use Latex in Bokeh axis label - Stack Overflow
Bokeh 2.4 adds support for LaTeX (and MathML) to some elements in Bokeh. Currently, you can use LaTeX on axis labels, tick labels,...
Read more >Releases — HoloViews v1.15.3
This is a major release with a large number of new features and bug fixes, as well as updates to Python and Panel...
Read more >Mathematical notation — Bokeh 3.0.3rc1 Documentation
To use LaTeX notation, you can pass a string directly to any supported element. This string needs to begin and end with one...
Read more >Changelog - Streamlit Docs
This page lists highlights, bug fixes, and known issues for official Streamlit releases. If you're looking for information about nightly releases, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think for latex in bokeh you need to use different delimiters like double dollar sign. Can you try it?
More info at https://docs.bokeh.org/en/2.4.3/docs/user_guide/styling.html#latex
@agustinaarroyuelo and I (but mostly Agustina) investigated the issue. Bokeh 2.x only supports latex rendering on the elements explicitly listed in the documentation. That is:
The examples in the docs restrict to these elements, but in your case you want to use latex rendering in a Title element, which doesn’t work.
This has already been fixed in the next release candidate for bokeh 3.0, at least for Title and Label elements (done in https://github.com/bokeh/bokeh/pull/11708), but as bokeh 3.0 is still at the release candidate stage, you’ll need to do
pip install bokeh --pre
to try it out. It is also a major version which probably has some backward incompatible changes, so some of the bokeh code in ArviZ might not work with it. I will be closing the issue as it is nothing to be fixed on our side, but feel free to let us know how it goes if you try this. We’ll test ArviZ with bokeh 3.0 once the api is final and a release is made.