Skip to content

Proposal: image layer above grid lines and below traces #4106

Closed

Description

@jonmmease

Currently images and shapes support a layer property to control whether objects are rendered 'above' the traces in the figure or 'below'. As shown in the following example, the 'below' mode also places the images/shapes below the grid lines.

CodePen: https://codepen.io/jonmmease/pen/EqbLej

newplot (3)

I find the the gridlines a bit distracting when placed on top of the image, and I would like to propose a third 'layer' option, 'between', that would place images/shapes above the gridlines and below the traces.

Do you think this would this require adding a new layer to the svg plot? or could the shapes/image be added to the layer the gird is currently drawn on?

Activity

  1. etpinard commented on Aug 5, 2019

    @etpinard
    Contributor

    Yep, I like the idea of adding a third layer value (that's why we added this attribute as an enumerated as opposed to a boolean).

    Now, I would prefer something more precise than 'between'. Maybe 'above grid' would be better? In other words, above means "above everything', below means "below everything" and upcoming layer values will be named as either "above something" or "below something"`. What do you think?

    Do you think this would this require adding a new layer to the svg plot?

    Yes, most likely we'll need that in order to get showgrid and images[i].visible relayout calls to work correctly.

  2. etpinard commented on Aug 5, 2019

    @etpinard
    Contributor

    Come to think of it, maybe adding layer: 'below traces' would be even better for your use case?

  3. jonmmease commented on Aug 5, 2019

    @jonmmease
    ContributorAuthor

    Yeah, I like that naming approach. layer: 'below traces' is probably the best name/meaning for what I'm interested in.

  4. nicolaskruchten commented on Oct 31, 2019

    @nicolaskruchten
    Contributor

    @jonmmease is this still relevant in an image trace-type world?

  5. jonmmease commented on Oct 31, 2019

    @jonmmease
    ContributorAuthor

    Nah, I don't think so.

  6. gemmavnash commented on Apr 29, 2020

    @gemmavnash

    @jonmmease is this still relevant in an image trace-type world?

    Hi. I don't understand the above and want to have my shapes between my grids and traces. How do I go about this? Thanks in advance.

  7. nicolaskruchten commented on Apr 29, 2020

    @nicolaskruchten
    Contributor

    @gemmavnash if you can post at https://community.plotly.com/ describing what you're trying to do, we'll try to help you :)

  8. nicolaskruchten commented on Apr 30, 2020

    @nicolaskruchten
    Contributor

    This is still relevant in the case of shapes, however, as pointed out in https://community.plotly.com/t/show-shapes-below-traces-and-above-grid/38629/3

  9. vlastimil-dolejs commented on Apr 29, 2021

    @vlastimil-dolejs
    Contributor

    Hi, I'm struggling with the same issue - the shape with layer below is overlayed by the grid. I have found a workaround (which is not perfect, but better than nothing).
    I'm setting both xaxis.gridcolor and yaxis.gridcolor to rgba(0, 0, 0, 0.07). This is the same as the default #eee if you have a white background, but will not overlay/hide the shape line that is below the grid. It will just slightly darken it.
    Hope this will help someone. Still, it would be helpful to be able to define above grid/below trace layer for the shapes.

  10. yotkadata commented on Jan 13, 2023

    @yotkadata

    +1 For this proposal. I am also working with a (line) shape that should appear below traces but above the grid.

  11. wmachadoa commented on Jan 26, 2023

    @wmachadoa

    Any follow up on this proposal? Or has anyone found a work-around for shapes?

  12. subsurfaceiodev commented on Mar 16, 2023

    @subsurfaceiodev

    We also need this feature! Any updates on this?

  13. jorge243 commented on May 16, 2023

    @jorge243

    Hi! Is there any solution yet for this issue? I love plotly and its great utility but i find it hard to believe that such a basic and essential task like this can't be achieved.

  14. carschandler commented on Jan 29, 2024

    @carschandler

    Bump!

  15. marcosberghahn commented on Feb 27, 2024

    @marcosberghahn

    oh my, old issue hun?
    so + 1 needing this.

  16. Coding-with-Adam commented on Jul 1, 2024

    @Coding-with-Adam
    Contributor

    Solved by #6927

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions