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
match_aspect
parameter for bokeh's BoxZoomTool
is not working
#6211
Comments
I believe the issue arises when A workaround is using Panel: import panel as pn
import numpy as np
import holoviews as hv
from bokeh.models import BoxZoomTool
pn.extension()
hv.extension("bokeh")
print(f"{hv.__version__=}")
x, y = np.mgrid[-50:51, -50:51] * 0.1
box_zoom = BoxZoomTool(match_aspect=True)
img = hv.Image(np.sin(x**2 + y**2), bounds=(-1, -1, 1, 1))
pn.Tabs(
img.relabel("Image").opts(default_tools=[box_zoom]),
img.sample(x=0).relabel("Cross-section"),
) |
Specifying However, I'm working with map data and therefore different objects and this does not suit my issue. I spent some time creating a minimal example of my particular situation and will update the original description of this issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ALL software version info
Python: 3.11.9
JupyterLab: 4.1.5
Holoviews: 1.18.3
Bokeh: 3.3.4 and 3.4.1
Description of expected behavior and the observed behavior
I’ve been plotting map data using holoviews and geoviews with the bokeh backend.
Bokeh has a zoom tool called BoxZoomTool, which allows drawing a rectangle to zoom in. Setting the kwarg
match_aspect=True
results in maintaining the aspect ratio, which is meaningful when working with maps. Apparently, holoviews doesn’t properly use pass theBoxZoomTool
to bokeh as match_aspect=True does not have any effect.Complete, minimal, self-contained example code that reproduces the issue
Working
BoxZoomTool
with native bokeh only (version 3.4.1 and 3.3.4, both working as expected)Non-working holoviews code (version 1.18.3)
Non-working minimal example of my code (version 1.18.3)
Stack traceback and/or browser JavaScript console output
Screenshots or screencasts of the bug in action
The text was updated successfully, but these errors were encountered: