You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
I've noticed the same thing, but I'm starting to wonder if the margin is a red herring. Because when I omit the margin setting entirely, but change my browser window to a very small size, the set semi-automatic axes range gets overridden again. when I maximize the browser window (back to its initial size when the plot was rendered), the ranges are still wrong. If I press the "reset axes" button above the figure, the ranges snap back to the initial (correct) semi-automatic limits.
Another suspicious feature is that if I set "large" margins (e.g. margin_l=200) then the initial render of the figure is correct. When I set "small" margins (e.g. margin_l=5) then already the initial render violates the requested semi-automatic ranges.
Here's my minimal example that shows the "window unminimize/resizing leads to wrong range recalculation until axes are reset" issue (on my 1920x1200 resolution display in case the aspect ratio matters):
I create a figure like so
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])
(specify100
instead ofNone
) and keep themargin_b
line uncommented, the behavior is correct again.The text was updated successfully, but these errors were encountered: