Answers for "stack in plotly"

1

plotly stack

from plotly.subplots import make_subplots
import plotly.graph_objects as go

fig = make_subplots(rows=len(df.columns), cols=1)

for i in len(df.columns):
  fig.append_trace(go.Scatter(
      x=[3, 4, 5],
      y=[1000, 1100, 1200],
  ), row=i+1, col=1)

# Edit the layout
fig.update_layout(height=600, width=600, title_text="Stacked Subplots")
fig.update_layout(title='<b>Title</b>',
                   xaxis_title='<b>x</b>',
                   yaxis_title='<b>y</b>')
fig.show()
Posted by: Guest on July-04-2021

Python Answers by Framework

Browse Popular Code Answers by Language