There are two ways of manipulating axis range in plotly with standard options:
- make a box selection to select a part of the graph
- drag and drop on the axis to zoom and pan
I want to disabled the second option but keep the first. To be clear:
I want to keep this functionality:
But I want to disable this:
How to do this?
I only know how to disable both (setting fixedrange=True for the given axis).
Here is the code for the figure shown above:
import plotly.graph_objects as go
fig = go.Figure()
fig.add_trace(go.Scatter(x=[1, 2, 3], y=[1, 3, 1]))
fig.update_yaxes(fixedrange=True)
fig.show()