✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🧬 Learn how to build RNA-Seq data apps with Python & Dash. Register for the May 20 Webinar!

How to force second y-axis to follow first, with just a scale factor between them?

For example, if I’m plotting speed and want to show it in km per hour on the left Y axis and meters per second on the right y axis, how would I do that? I need them to have the same zero line, and for the scale on one axis to be 3.6 times the scale on the other.

Currently, the only ways I’ve seen multiple axes implemented is for each axis to correspond to different data, with the axis ranges adjusting differently to match the data as the user zooms (in particular, with the autoscale button). This is good for some things, but what about when the axes need to follow a fixed scaling?

For an example of the problem, see http://plot.ly/~ajakef/12. If you zoom in on a small time window and hit autoscale, it totally messes up the two y axes–the 100% mark on the right moves to different values on the left axis.