Hi @jayveesea, in order to do this you need the Javascript figure object to communicate back to Python the value of its axis range. From Python you define the specification of a Javascript figure but after creating the figure it “lives its own life” in Javascript-land, without passing information back to Python. If you’re working in a Jupyter notebook environment you can create a FigureWidget
which would print the axis range on relayout events, and register a callaback to fig.layout.on_change
(like in https://plotly.com/python/click-events/ but for a different kind of events). Or you can use a Dash application with a callback listening to relayoutData
.
1 Like