Skip to content

Shapes layer: 'below' doesn't play well with subplots #1452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alexcjohnson opened this issue Mar 8, 2017 · 2 comments
Closed

Shapes layer: 'below' doesn't play well with subplots #1452

alexcjohnson opened this issue Mar 8, 2017 · 2 comments
Labels
bug something broken

Comments

@alexcjohnson
Copy link
Collaborator

I'm not sure this really has a solution even theoretically, if you consider the layering that needs to happen with inset plots (where the background of the inset plot needs to be drawn on top of the data of the main plot) but posting as a bug for discussion purposes since it's at the very least unexpected.

If you make a layer: 'below' shape that's data-referenced on one axis and paper-referenced on another, and it crosses two subplots (which could actually be a very nice way to highlight correlations between these subplots) the shape will NOT be below the data of both subplots.

Plotly.newPlot(gd,[
    {y:[1,2,3]},
    {y:[1,2,3],yaxis:'y2'}
],{
    yaxis:{domain:[0,0.4]},
    yaxis2:{domain:[0.6,1]},
    shapes:[{
        xref:'x',yref:'paper',type:'rect',
        x0:0.8,x1:1.2,y0:0,y1:1,
        fillcolor:'#eee',layer:'below'
    }]
})

screen shot 2017-03-08 at 12 38 35 am

@etpinard
Copy link
Contributor

etpinard commented Mar 8, 2017

Nice find. I hope the shape_below_traces isn't wrong.

I'd vote for making layer: 'below' correspongd to below all traces linked to the axis set in the shape xref or yref.

@alexcjohnson
Copy link
Collaborator Author

closed by #1453 - now layer: 'below' shapes and images are still in front of plot backgrounds in all cases EXCEPT on inset plots (any subplot that overlaps an earlier one without being explicitly overlaying) where the component is NOT referenced to both axes of that subplot. So for example, if x2/y2 is on top of x/y, a shape referenced to x2/y2 can still be seen with layer: below but one referenced to x2/paper, paper/y2, x/y, or anything else cannot be seen where it intersects the x2/y2 subplot.

This is, I believe, the minimal set of objects it's theoretically impossible to show (short of some sort of horribly complicated stitching together of different objects in different z layers, which wouldn't work that well anyway due to antialiasing and would have strange effects of data objects from the lower plot slicing through them.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

2 participants