Description
plotly 6.0.1
I create a figure like so
fig = go.Figure()
fig.add_trace(go.Scatter(x=np.arange(100), y=np.arange(100)))
fig.update_layout(xaxis_range=[50,None])
# fig.update_layout(margin_b=20)
fig.show()
Expected behavior
fig.update_layout(xaxis_range=[50,None])
(Line 3) should set the min xaxis value to be 50, while keeping the max value intact. It does this correctly (Correct: x-axis is from 50 to 100). Interestingly, when I click the modebar to download the plot as png, the xaxis range is incorrect in the output image.

Bug
If you uncomment the line fig.update_layout(margin_b=20)
(Line 4) which adjusts the bottom margin, the x axis range is back to its original value unaffected by Line 3 (Inorrect: x-axis is from 0 to 100). Interestingly, if you double click the plot to reset the axes, the x axis changes to the updated value (50 to 100).

Note:
Weirdly, if I change Line 3 to fig.update_layout(xaxis_range=[50,100])
(specify 100
instead of None
) and keep the margin_b
line uncommented, the behavior is correct again.