Skip to content

stat_summary_hex() brings values or bins out of order #5101

Closed
@aricht

Description

@aricht

Hi all,
plotting with stat_summary_hex() the resulting plot does not look as expected and seems to not represent the underlying data. The difference to a plot generated with stat_summary_2d() is striking, when I would expect them to look very similar.
I observed this problem in ggplot2_3.4.0 but not ggplot2_3.3.5.

The problem can be seen on the example data:

library(ggplot2)
d <- ggplot(diamonds, aes(carat, depth, z = price))

d + stat_summary_2d()

d + stat_summary_hex()

Thanks a lot in advance for looking into this!

Screenshot 2022-12-09 at 15 39 41
Screenshot 2022-12-09 at 15 39 15

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions