# Disable bokeh plot axis scrolling

**URL:** <https://discourse.holoviz.org/t/disable-bokeh-plot-axis-scrolling/285>\
**Category:** HoloViews\
**Created:** [March 4, 2020, 6:45pm UTC](https://discourse.holoviz.org/t/disable-bokeh-plot-axis-scrolling/285 "2020-03-04T18:45:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![digitaltopo](https://discourse.holoviz.org/letter_avatar_proxy/v4/letter/d/5e9695/32.png) [@digitaltopo](https://discourse.holoviz.org/u/digitaltopo)\
**Post date:** [March 4, 2020, 6:45pm UTC](https://discourse.holoviz.org/t/disable-bokeh-plot-axis-scrolling/285/1 "2020-03-04T18:45:22Z")

</div>

Is there any way to disable axis scrolling (for example using scroll wheel over x-axis zooms the axis)?

I’ve tried setting options for `default_tools`, `tools`, and `active_tools` without the `xwheel_zoom` and `ywheel_zoom` but it looks like the tools are not controlling this behavior? (I do need `wheel_zoom` for the plot though).

I’d like to **avoid** this behavior in a geoviews plot so that you can’t adjust the x and y axes:

 ![axis-scroll](https://discourse.holoviz.org/uploads/default/original/1X/cefe4153d6445e1d2a7f018aaad4a9a6383709ba.gif)

Relevant docs:

- [https://docs.bokeh.org/en/latest/docs/user\_guide/tools.html#wheelzoomtool](https://docs.bokeh.org/en/latest/docs/user_guide/tools.html#wheelzoomtool)
- [http://holoviews.org/user\_guide/Customizing\_Plots.html#Customizing-axes](http://holoviews.org/user_guide/Customizing_Plots.html#Customizing-axes)

---

<div class="post-metadata">

**Author:** ![digitaltopo](https://discourse.holoviz.org/letter_avatar_proxy/v4/letter/d/5e9695/32.png) [@digitaltopo](https://discourse.holoviz.org/u/digitaltopo)\
**Post date:** [March 5, 2020, 12:45am UTC](https://discourse.holoviz.org/t/disable-bokeh-plot-axis-scrolling/285/3 "2020-03-05T00:45:56Z")

</div>

This feature was added here: [https://github.com/bokeh/bokeh/issues/7815](https://github.com/bokeh/bokeh/issues/7815)  
Relevant discussion: [https://github.com/pyviz-topics/EarthSim/issues/45](https://github.com/pyviz-topics/EarthSim/issues/45)

I was able to achieve this functionality by creating a custom instance of the `WheelZoomTool`:

```python
import geoviews.feature as gvfs
import holoviews as hv
from bokeh.models import WheelZoomTool

wheel_zoom = WheelZoomTool(zoom_on_axis=False)
gvts.OSM().opts(default_tools=['pan', wheel_zoom],)

```

---

<div class="post-metadata">

**Author:** ![philippjfr](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/philippjfr/32/7_2.png) [@philippjfr](https://discourse.holoviz.org/u/philippjfr)\
**Post date:** [March 5, 2020, 10:24am UTC](https://discourse.holoviz.org/t/disable-bokeh-plot-axis-scrolling/285/4 "2020-03-05T10:24:56Z")

</div>

Thanks for posting the solution here. Could you do me another favor and file a GeoViews issue to do this by default on geographic plots?
