D
D
Danil Samodurov2021-06-05 18:46:09
Python
Danil Samodurov, 2021-06-05 18:46:09

How to make several graphs in plotly in a column with one common x-axis and different y-axes?

Hello. I am struggling with the problem of making several graphs in a column in plotly with a common abscissa axis, so that each graph has its own y-axis, with its own units of measurement. This is necessary so that you can select some area on any graph, and all other graphs adjust the abscissa range to the selected one. Very similar functionality is described on this manual page: https://plotly.com/python/facet-plots/ . Here is an example code:

import plotly.express as px

df = px.data.stocks(indexed=True)
fig = px.line(df, facet_row="company")
fig.show()

However, here all graphs have a common not only abscissa axis, but also ordinates, and when selecting some area on some graph, it leads to range adjustment on both axes on other graphs.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question