✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

Tie right Y axis to the left Y axis instead of to data

Is it possible, in a Plotly chart, to create a second Y axis that is directly tied to the first Y axis rather than to the data itself? For example, let’s say we are plotting a set of data points with speed (in meters per second) relating to a timestamp. We want to plot these in a diagram where the left Y axis shows speed in m/s, but the right Y axis shows speed in km/h. As the ratio between m/s values and km/h value is fixed, we want the right Y axis not be affected directly by the data points, but rather directly by the other Y axis. Is this possible somehow?

I would prefer not having to calculate the y axis ranges manually. Is there a way to trigger autorange calculation for the right y axis without any related data? I’ve tried adding a new data series and set its visibility to false, but that causes the y axis to change as if the data was not there.

I still have no idea how to accomplish what I want.