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
We could be smarter about axis anchors for subplots, basing their default values off the traces we have.
In a new mock I made for date axes, there are 7 stacked subplots, each with one trace and its own x and y axes. All the traces have: xaxis: 'x<n>', yaxis: 'y<n>'
and all the x axes have layout obects: xaxis<n>: {anchor: 'y<n>'}
With smarter defaults, I would not have needed to include these x axis objects at all since 'x<n>' is only ever used with 'y<n>' in the data. In fact, in principle my y axes should also be anchored to the corresponding x axes... I didn't do that, and it didn't matter here because all the x axes have domain [0, 1], but if I were to change some of these domains, then I would be in for some confusion as the y axes wouldn't move as I would expect.
This would not be backward compatible, so I guess should be included in v2.0 if we do it, but I can't really think of a situation where people would be depending on the existing defaults.
Just encountered this again as a really peculiar failure mode for gl2d plots: gl2d_stacked_subplots does not have explicit anchors for yaxis2 and yaxis3, which is fine for positioning them (all the x axes have the same left edges) but the plot behaves badly:
Click "autoscale" (or zoom in/out) in the modebar, and all but one subplot gets emptied out:
Similar things happen to this plot on Plotly.redraw, Plotly.restyle, and Plotly.relayout calls.
Behavior after this is weird too: trying to zoom in the top subplot (with a zoombox) causes the top y axis and the BOTTOM x axis to zoom.
The problem is we have xy2 and xy3 subplots as well as x2y2 and x3y3 - for some reason the first time around, these are below the real ones, but on redraw they pop to the top.
Keep clicking buttons up there and after a little while you get WARNING: Too many active WebGL contexts. Oldest context will be lost. appearing in the console.
If you explicitly set yaxis2.anchor='x2', yaxis3.anchor='x3' the plot behaves as expected.
I suspect actually that every time anyone has created a plot with a missing axis anchor, it has been incorrect but not noticed because the axis was in the correct location (as in the examples here), so we wouldn't need to wait for v2 to fix this.
Anyway, when we do work on this, we should make sure to test constrained axes in gl2d plots per #1522 (comment)
Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson
Activity
alexcjohnson commentedon Apr 1, 2017
Just encountered this again as a really peculiar failure mode for gl2d plots: gl2d_stacked_subplots does not have explicit anchors for
yaxis2andyaxis3, which is fine for positioning them (all the x axes have the same left edges) but the plot behaves badly:Plotly.redraw,Plotly.restyle, andPlotly.relayoutcalls.xy2andxy3subplots as well asx2y2andx3y3- for some reason the first time around, these are below the real ones, but on redraw they pop to the top.WARNING: Too many active WebGL contexts. Oldest context will be lost.appearing in the console.If you explicitly set
yaxis2.anchor='x2', yaxis3.anchor='x3'the plot behaves as expected.alexcjohnson commentedon Apr 3, 2017
I suspect actually that every time anyone has created a plot with a missing axis anchor, it has been incorrect but not noticed because the axis was in the correct location (as in the examples here), so we wouldn't need to wait for v2 to fix this.
Anyway, when we do work on this, we should make sure to test constrained axes in gl2d plots per #1522 (comment)
gvwilson commentedon Jun 6, 2024
Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson