Hello, I want to invert secondary y only, I have tried fig.update_yaxes(autorange='reversed', row=1, col=1)
, and it will invert both y axes.
Well, I tried
fig.layout['yaxis2']['autorange']='reversed'
fig.layout['yaxis2']['range'] = [50, 0]
And now the secondary y axis is inverted, however the secondary y axis value range is not set.
Hi @JackTang ,
If you use autorange
attribute, to set range you can add minallowed
and maxallowed
attribut inside autorangeoptions
.
fig.update_layout(
yaxis2=dict(
autorange="reversed",
autorangeoptions=dict(
minallowed=0,
maxallowed=50
)
)
)
Thanks @farispriadi ! It works like a charm