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

Resolution of geom_tile() per panel #5764

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

teunbrand
Copy link
Collaborator

This PR aims to fix #5740.

Briefly, when width and height are missing, these are inferred from the data.
In #5125, resolutions were computed per panel instead of over the whole layer.
This PR follows that approach but for geom_tile().

Reprex from issue:

devtools::load_all("~/packages/ggplot2/")
#> ℹ Loading ggplot2

data <- data.frame(x = rep(seq(0, 1, length.out = 11), each = (11) * 2),
                   y = c(seq(100, 200, length.out = 11), seq(0, 1, length.out = 11)),
                   z = rnorm(((11) ** 2 * 2)),
                   var = rep(c("T1", "T2"), each = 11))

ggplot(data) +
  geom_tile(aes(x = x, y = y, fill = z)) +
  facet_wrap(vars(var), scales = "free_y")

Created on 2024-03-11 with reprex v2.1.0

@teunbrand
Copy link
Collaborator Author

Quick to note to self: should update to reflect #5765 if that gets merged first.

Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once you've updated the PR as per your last comment

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_tile() not working with facet_wrap() for different ranges of y-axes.
2 participants