Skip to content
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

avoid replication of aesthetics across hex bins #5045

Merged
merged 3 commits into from
Dec 7, 2022

Conversation

thomasp85
Copy link
Member

Fix #5037 and Fix #5044

This fixes a regression in the hex bin update in 3.4.0

@yutannihilation
Copy link
Member

Thanks for addressing this. Could you describe what was the problem and what the fix is? As I wrote on #5037 (comment), it seems 4e3f0e1 was the first commit where geom_hex() is broken, and I don't understand why this fixes the problem (and what had gone wrong).

@thomasp85
Copy link
Member Author

The issue was pretty dumb and benign... The coordinates for the hexes comes from replicating each input point six times and alter the values so it resembles a hexagon. During my update I took the gpar values from this replicated data.frame as well even though these should not be replicated. This lead to the fill replication reported. The unit tests will now guard against this

@yutannihilation
Copy link
Member

Ah, I see. Thanks for the clear explanation! Then, this looks good to me.

@yutannihilation
Copy link
Member

@thomasp85
May I merge this so that the users can easily check if their hexbin problem is fixed in the dev version?

@alekseybelikov
Copy link

I don't understand. What is the solution? I still have this problem with ggplot 3.4.0
Screenshot 2024-10-18 at 17 47 31

@wmoldham
Copy link

@alekseybelikov It looks like this was patched in 3.4.1. Try to upgrade to at least this version.

@alekseybelikov
Copy link

@alekseybelikov It looks like this was patched in 3.4.1. Try to upgrade to at least this version.

Hi, unfortunately version 3.4.0 is specifically required for a scATACseq analysis tool ArchR to function: GreenleafLab/ArchR#2130 (comment)

@alekseybelikov
Copy link

alekseybelikov commented Oct 18, 2024

Ok, just upgraded to 3.4.1 and it solved the problem, but not sure if now new problems will arise in ArchR due to this.

ggplot_url <- "https://cran.r-project.org/src/contrib/Archive/ggplot2/ggplot2_3.4.1.tar.gz"
install.packages(ggplot_url, repos=NULL, type="source")
Screenshot 2024-10-18 at 18 36 29

@teunbrand
Copy link
Collaborator

Looks to me like ArchR was trying to grab a legend by name that has become outdated in ArchR::fixPlotSize().
Once #6094 gets merged, they wouldn't have to resort to that fragile way of setting the plot size.

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

Successfully merging this pull request may close these issues.

geom_hex color representation is wrong hexbin is broken
5 participants