@vaclavku, I identified the issue of your code.
When you define:
fig = tools.make_subplots(rows=5, cols=3,
specs=[[{‘rowspan’: 2, ‘colspan’: 2}, None,{‘rowspan’: 2}],
[None, None, None],
[{‘colspan’: 2}, None, {}],
[{‘rowspan’: 2, ‘colspan’: 2}, None, {‘rowspan’: 2}],
[None, None, None]],
vertical_spacing=0.075,
horizontal_spacing=0.05)
fig.layout #inspect fig.layout
Layout({
'xaxis': {'anchor': 'y', 'domain': [0.0, 0.6399999999999999]},
'xaxis2': {'anchor': 'y2', 'domain': [0.72, 1.0]},
'xaxis3': {'anchor': 'y3', 'domain': [0.0, 0.6399999999999999]},
'xaxis4': {'anchor': 'y4', 'domain': [0.72, 1.0]},
'xaxis5': {'anchor': 'y5', 'domain': [0.0, 0.6399999999999999]},
'xaxis6': {'anchor': 'y6', 'domain': [0.72, 1.0]},
'yaxis': {'anchor': 'x', 'domain': [0.6449999999999999, 0.9999999999999999]},
'yaxis2': {'anchor': 'x2', 'domain': [0.6449999999999999, 0.9999999999999999]},
'yaxis3': {'anchor': 'x3', 'domain': [0.42999999999999994, 0.57]},
'yaxis4': {'anchor': 'x4', 'domain': [0.42999999999999994, 0.57]},
'yaxis5': {'anchor': 'x5', 'domain': [0.0, 0.355]},
'yaxis6': {'anchor': 'x6', 'domain': [0.0, 0.355]}
})
the layout is set up and assignments like these:
fig['layout']['xaxis1'] = dict(rangeslider = dict( visible = False ))
fig['layout']['xaxis2' ] = dict(rangeslider = dict( visible = False ))
redefine the fig['layout']['xaxis1']
, and fig['layout']['xaxis2']
, and your initial settings are lost:
fig.layout
Layout({
'xaxis': {'rangeslider': {'visible': False}},
'xaxis2': {'rangeslider': {'visible': False}},
'xaxis3': {'anchor': 'y3', 'domain': [0.0, 0.6399999999999999]},
'xaxis4': {'anchor': 'y4', 'domain': [0.72, 1.0]},
'xaxis5': {'anchor': 'y5', 'domain': [0.0, 0.6399999999999999]},
'xaxis6': {'anchor': 'y6', 'domain': [0.72, 1.0]},
'yaxis': {'anchor': 'x', 'domain': [0.6449999999999999, 0.9999999999999999]},
'yaxis2': {'anchor': 'x2', 'domain': [0.6449999999999999, 0.9999999999999999]},
'yaxis3': {'anchor': 'x3', 'domain': [0.42999999999999994, 0.57]},
'yaxis4': {'anchor': 'x4', 'domain': [0.42999999999999994, 0.57]},
'yaxis5': {'anchor': 'x5', 'domain': [0.0, 0.355]},
'yaxis6': {'anchor': 'x6', 'domain': [0.0, 0.355]}
})
You should make updates, not assignments:
fig['layout']['xaxis1'].update(rangeslider = dict( visible = False ))
fig['layout']['xaxis2'].update(rangeslider = dict( visible = False ))
Now `
fig.layout.xaxis1 # displays:
layout.XAxis({
'anchor': 'y', 'domain': [0.0, 0.6399999999999999], 'rangeslider': {'visible': False}
})
i.e. the initial setting were preserved.