Skip to content

Add non_missing_aes to geom_tile #4683

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

Merged
merged 3 commits into from
Dec 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# ggplot2 (development version)

* `geom_tile()` now correctly recognises missing data in `xmin`, `xmax`, `ymin`,
and `ymax` (@thomasp85 and @sigmapi, #4495)

* `geom_hex()` will now use the binwidth from `stat_bin_hex()` if present,
instead of deriving it (@thomasp85, #4580)

Expand Down
5 changes: 5 additions & 0 deletions R/geom-tile.r
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,10 @@ GeomTile <- ggproto("GeomTile", GeomRect,

required_aes = c("x", "y"),

# These aes columns are created by setup_data(). They need to be listed here so
# that GeomRect$handle_na() properly removes any bars that fall outside the defined
# limits, not just those for which x and y are outside the limits
non_missing_aes = c("xmin", "xmax", "ymin", "ymax"),

draw_key = draw_key_polygon
)