-
Notifications
You must be signed in to change notification settings - Fork 50
Heatmap coloring boxes that should be empty #407
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
Comments
What's happening IMO is the following. Makie sees a gap in the axis (from using CairoMakie
heatmap([1, 2, 4, 5], [1, 2, 3, 4], rand(4)) The conversion is happening here. This should probably be fixed on the Makie side first. Maybe one could allow an optional |
@piever says
In the linked Makie issue @jkrumbiegel says
Either way, this issue makes me nervous and I hope it can be fixed one way or another. |
I checked what ggplot's library(ggplot2)
df <- data.frame(
x = c(1, 2, 4),
y = c(4, 5, 6),
fill = c(1, 2, 3)
)
ggplot(df, aes(x, y, fill = fill)) + geom_tile() This looks like the behavior you want at first, but you can see that it differs from library(ggplot2)
df <- data.frame(
x = c(0, 1, 2.2, 3.9),
y = c(4, 5, 6, 7),
fill = c(1, 2, 3, 4)
)
ggplot(df, aes(x, y, fill = fill)) + geom_tile() I actually agree with you that the behavior is a bit confusing when we convert from x, y, z vectors to x centers, y centers, z matrix in Makie, that you can easily end up with an irregular grid because some x or y values are completely missing by chance. This would never happen with the vec, vec, matrix signature because you know the shape of the matrix, but that's not the one we can use from AoG with its tabular input data. So I'm inclined to tighten that interface down, but I'm not completely sure how. Maybe it should only be allowed to pass x and y vectors with equidistant centers, or multiples of those (that's when you get gaps). This would probably have to be slightly accomodating towards floating point differences, but then we'd say in Makie, for unequal bin sizes you have to use the edge version where you specify n+i x values. And if we want to match library(ggplot2)
df <- data.frame(
x = c(1, 2, 1),
y = c(1, 1, 1),
fill = c(1, 2, 3)
)
ggplot(df, aes(x, y, fill = fill)) + geom_tile() |
Maybe we can use spy more for this? From the examples it looks like we're talking about sparse data anyways. |
I expected the
!
facetm
row to be empty but it has colored boxes without text. There is also something strange going on with the tick alignment around there.The text was updated successfully, but these errors were encountered: