I've got 10+ subplots which I want to disable the grid lines for showgrid=False
. I need to do that for both x and y axes.
This answer seems to be close, but I can't extend it to do what I want.
In the answer above they show how to set the range for all subplots:
myRange=[0,6]
for ax in fig['layout']:
if ax[:5]=='xaxis':
fig['layout'][ax]['range']=myRange
But when I try that with showgrid
I get an error TypeError: 'NoneType' object does not support item assignment
I tried:
for ax in fig['layout']:
fig['layout'][ax]['showgrid'] = False
Using just update_layout
only changes the first subplot:
fig.update_layout(
xaxis=dict(showgrid=False),
yaxis=dict(showgrid=False)
)