You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Disabling the zoom in, zoom out, and autoscale buttons for specific axes is supported on cartesian axes using the `modebardisable` attribute. In the following example, the zoom in and zoom out buttons are disabled on the `xaxis`, meaning these buttons only zoom in and out on the `yaxis`. Disable the autoscale button using `modebardisable='autoscale'`. You can also disable both autoscaling and zoom buttons using `modebardisable='zoominout+autoscale'`.
331
+
332
+
```python
333
+
import plotly.graph_objects as go
334
+
import plotly.data
335
+
336
+
df = plotly.data.stocks()
337
+
338
+
fig = go.Figure(
339
+
data=[
340
+
go.Scatter(
341
+
x=df['date'],
342
+
y=df['GOOG'],
343
+
mode='lines+markers',
344
+
name='Google Stock Price'
345
+
)
346
+
],
347
+
layout=go.Layout(
348
+
title='Google Stock Price Over Time with Mode Bar Disabled',
349
+
xaxis=dict(
350
+
title='Date',
351
+
# Try zooming in or out using the modebar buttons. These only apply to the yaxis in this exampe.
352
+
modebardisable='zoominout'
353
+
),
354
+
yaxis=dict(
355
+
title='Stock Price (USD)',
356
+
)
357
+
)
358
+
)
359
+
fig.show()
360
+
```
361
+
326
362
### Configuring Figures in Dash Apps
327
363
328
364
The same configuration dictionary that you pass to the `config` parameter of the `show()` method can also be passed to the [`config` property of a `dcc.Graph` component](https://dash.plotly.com/dash-core-components/graph).
0 commit comments