Subplots property

Is it possible to apply aspectmode for all subplots? It worked only for the first one…

fig = make_subplots(
    rows=1, cols=2,
    specs=[[{'type': 'surface'}, {'type': 'surface'}]])
    

fig.add_trace(
    go.Surface(x=X, y=Y, z=y1, colorscale='Viridis', showscale=False),
    row=1, col=1)

fig.add_trace(
    go.Surface(x=X, y=Y, z=U(Y,X), colorscale='RdBu', showscale=False),
    row=1, col=2)



fig.update_layout(
    scene = dict(aspectmode='cube'),

    height=800,
    width=800
    
)

fig.show()

Welcome to the community, @BaDWerewolf.

Try this:

# update layout (dimensions)
fig.update_layout(
    #scene = dict(aspectmode='cube'),
    height=800,
    width=800
)

# update aspectmode for all scenes
fig.for_each_scene(lambda x: x.update({'aspectmode': 'cube'}))
1 Like

It works! TY <3

1 Like