I need your help.
I would like to ask for your help regarding plotly.
As shown in the picture below, I drew a graph with two x-axis up and down using plotly.
However, I would like to draw a 2x2 shape graph with two x-axis up and down like the picture below, but I can’t figure it out.
I’m looking for an angel to help me.
Please I beg you.
Thank you.
#The code that created one chart.
import numpy as np
import plotly.graph_objects as go
from plotly.subplots import make_subplots
fig=make_subplots(
specs=[[{“secondary_y”: True}]])
print(fig.layout)
fig.update_layout(xaxis2= {‘anchor’: ‘y’, ‘overlaying’: ‘x’, ‘side’: ‘top’},
yaxis_domain=[0, 0.94]);
fig.add_trace(
go.Bar(x=[1, 2, 3, 4],
y=[7, 4, 5, 6],
name=“bar”,
), secondary_y=False)
fig.add_trace(
go.Scatter(x=[-2, -1, 0, 1],
y=[4, 2, 5, 6],
name=“scatt1”,
line_color="#ee0000"), secondary_y=True)
fig.data[1].update(xaxis=‘x2’)
fig.update_layout(width=700, height=475)