I’ve looked into this problem since this reply and am realizing that I was mistaken what the issue was and it is independent of scaleanchor/scaleratio, and using gridlines does show that scaleanchor/ratio are working properly. The problem is that my graph’s axes ranges are not actually staying within the specified ranges, though I feel I should create a separate question for this.
Still using the code above (plus additional code to display gridlines), here’s what the graph looks like when adding a second trace indicated by red dots where the graph ranges should be constrained:
mode = 'markers',
x = [xmin, xmin, xmax, xmax],
y = [ymin, ymax, ymin, ymax],
marker = dict(
color = 'red'
It is clear from here that scaleanchor/ratio were working as intended. Sorry for the confusion.