Skip to content

Commit 74e1103

Browse files
authored
Add non_missing_aes to geom_tile (#4683)
1 parent 4e3f0e1 commit 74e1103

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# ggplot2 (development version)
22

3+
* `geom_tile()` now correctly recognises missing data in `xmin`, `xmax`, `ymin`,
4+
and `ymax` (@thomasp85 and @sigmapi, #4495)
5+
36
* `geom_hex()` will now use the binwidth from `stat_bin_hex()` if present,
47
instead of deriving it (@thomasp85, #4580)
58

R/geom-tile.r

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,10 @@ GeomTile <- ggproto("GeomTile", GeomRect,
113113

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

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

0 commit comments

Comments
 (0)