This only works when you want to share all x/y axes in a given subplot row/column, but make_subplots
takes kwargs shared_xaxes
and shared_yaxes
that can be set to "rows"
, "columns"
, or "all"
.
If you need something more complex (e.g. only some of the subplots in a row sharing the same yaxis), you can specify the x/y axis for a trace as a kwarg in the trace constructor (e.g. scatter
, etc) as eg yaxis="y2"
. (I don’t remember off hand which corner/direction axis counting starts.) Higher axis number will create a new one if it doesn’t already exist.