Skip to content

Allow heatmaps to understand line objects #898

Closed

Description

@cpsievert

This could be used to effectively set the stroke of heatmap cells. Without it, I can't replicate this ggplot2 example -- plotly/plotly.R#699

Activity

  1. added
    feature
    on Sep 2, 2016
  2. talgalili commented on Apr 9, 2017

    @talgalili

    BUMP.
    I hope this could be resolved so that heatmaps would include the option to show cells grid.

    Thanks.

  3. rreusser commented on Apr 9, 2017

    @rreusser
    Contributor

    @talgalili xgap and ygap from #868 are not an exact match to this feature, but they do accomplish padding for the cells, which may be of some help.

  4. talgalili commented on Apr 9, 2017

    @talgalili

    Thanks @rreusser .
    @cpsievert - could this help solve this: plotly/plotly.R#699
    what do you think?

  5. cpsievert commented on Apr 9, 2017

    @cpsievert
    Author

    @talgalili no, xgap/ygap seem to specify a constant gap between each cell.

    Also, for ggplot2 parity, we need each cell border to respect linetype. Just adding lty = 4 to your example yields:

    screen shot 2017-04-09 at 11 43 23 am

  6. talgalili commented on Apr 9, 2017

    @talgalili

    Hi @rreusser
    Since my personal need for this is the ability to have a "grid like" look for the heatmaply R package, then actually "a constant gap between each cell" (defined on top of a ggplotly object derived from geom_tile), would be great. However, I'm not sure how to map that to the existing Aesthetics of geom_tile...

  7. cpsievert commented on Apr 9, 2017

    @cpsievert
    Author

    @talgalili use style() to modify the attributes of existing traces:

    style(p, xgap = 5)
  8. talgalili commented on Apr 10, 2017

    @talgalili

    Thanks @cpsievert , this is very helpful! It would still be nice to have this issue resolved directly. But for now, this resolved the main feature I was looking for (i.e.: to add a grid of lines to heatmaply - talgalili/heatmaply@0f9f73b).

  9. added this to the ggplotly parity milestone on May 10, 2017
  10. adriwitek commented on Mar 1, 2021

    @adriwitek

    I need to make a grid over a annotated heat map and this is very frustrating

  11. gvwilson commented on Jun 5, 2024

    @gvwilson
    Contributor

    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

  12. rabyj commented on Apr 28, 2025

    @rabyj

    I think this is still pertinent. This isn't the first time I try to add grid lines in-between cells, without success. I didn't find any other issue related to this, but I might have missed it (I'm working from the Python side, but I imagine it would have to be implemented here first).

    Currently, the grid lines from axes are centered on the cells, instead of at their edges.

    I'm trying to reproduce something like this, and parameters xgap /ygap + plot_bgcolor are not enough, since I have nans that share the background color.

    Should a new issue be opened?

    Image

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

    feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions