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

hexbin fails for small cell sizes in CairoMakie #4768

Open
astertaylor opened this issue Feb 5, 2025 · 3 comments
Open

hexbin fails for small cell sizes in CairoMakie #4768

astertaylor opened this issue Feb 5, 2025 · 3 comments
Labels
bug CairoMakie This relates to CairoMakie, the vector backend for Makie based on Cairo. rendering typically backend specific scatter

Comments

@astertaylor
Copy link

For sufficiently small hexbin sizes, the bin is not plotted and no hexes show up. MWE:

using CairoMakie
x=rand(300); y=rand(300)
hexbin(x, y, cellsize=0.01, threshold=0, strokewidth=0.01) # this works
hexbin(x, y, cellsize=0.001, threshold=0, strokewidth=0.01) # here, nothing shows up

This example is slightly contrived (nobody needs bins so small), but the bug is appearing in a separate usecase where the minimum bin size is much larger. What can I do to fix this, and what could be going wrong?

The issue does not arise in the GLMakie backend...

Running Makie 0.22.1, the error still arises in a fresh environment. Running on Ubuntu 24.04.

@astertaylor astertaylor added the bug label Feb 5, 2025
@ffreyer ffreyer added CairoMakie This relates to CairoMakie, the vector backend for Makie based on Cairo. rendering typically backend specific plot Related to plot object labels Feb 26, 2025
@astertaylor
Copy link
Author

After further investigation, I've determined that this is actually an issue with scatter. Specifically, for sufficiently small marker sizes, scatter fails to plot anything. Once again, this is only in CairoMakie.

@asinghvi17
Copy link
Member

Do you have an MWE for that behavior?

@ffreyer ffreyer added scatter and removed plot Related to plot object labels Mar 12, 2025
@ffreyer
Copy link
Collaborator

ffreyer commented Mar 12, 2025

Probably this then?

(abs(det(jl_mat)) < 1) && return

Reducing this will probably cause issues in tests:
#4663 (comment)

Also we had a isapprox(markersize, 0) && return before with a comment that letting it through breaks Cairo state, so something like the det() or this should continue to be there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug CairoMakie This relates to CairoMakie, the vector backend for Makie based on Cairo. rendering typically backend specific scatter
Projects
None yet
Development

No branches or pull requests

3 participants