I need help in determining how to handle a variable number of xaxis values when defining the layout.
I am doing a chart which has grouped stacked bar charts, and am using the technique of putting each group on its own xaxis. Works great, except for the fact that I have a variable number of groups to graph, and each xaxis has a label xaxis, xaxis2, xaxis3, etc.
Here is a snippet of code:
layout = go.Layout(barmode=‘stack’,
xaxis=dict(domain=[0, 0.11]
anchor=‘x1’,
title=‘Matt’),
xaxis2=dict(domain=[0.125, 0.235]
anchor=‘x2’,
title=‘Tom’),
xaxis3=dict(domain=[0.250, 0.365]
anchor=‘x2’,
title=‘Tom’),
etc.
)
I will have between 1-10 xaxis depending on my data. So how do I construct code that works by dynamically constructing the parameters to go.Layout? Or is there another way to get the layout to have the xaxis?
Thanks in advance from a person new to to Plotly.