VictorBezak / Plotly_Multi-Axes_Gridlines

How do you make the grid-lines for multiples y-axes match up with each other? Start at the README for a full explanation, or go straight to the code!
23 stars 2 forks source link

Gridlines resetting on zoom #4

Open Switchbot-Nova opened 1 year ago

Switchbot-Nova commented 1 year ago

When I select an area to zoom in on it works but then after double clicking to zoom back out the gridlines reset to what they were before implementing this solution.

VictorBezak commented 1 year ago

The sync tickmode option has been fully released as a native configuration option within Plotly.js https://github.com/plotly/plotly.js/releases/tag/v2.18.0

Are you able to update to v2.18.0 of Plotly to try to implement this natively? If so, I'd be curious to know if the new feature is intuitive enough for you to implement without aid, but if you upgrade and need some assistance in implementing it, I'd be happy to assist!

Switchbot-Nova commented 1 year ago

Hi,

Ive tried implementing tickmode sync before which works for the gridlines but the axes do not get aligned at 0, see screenshot image

VictorBezak commented 1 year ago

I'll explore this within the next few days! Thanks for letting me know!

Qcellaris commented 9 months ago

I noticed that the tickmode='sync' option in Plotly is not exactly doing what your original code was intended to do, namely: make both y axes use the same grid lines, make sure the traces use the same grid line at y = 0 (also when traces can have negative values), and make sure that the tick labels of the second y axis have nice round numbered values instead of these very odd decimal numbers.