forked from tidyverse/ggplot2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeom-blank.r
40 lines (38 loc) · 988 Bytes
/
geom-blank.r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#' Draw nothing
#'
#' The blank geom draws nothing, but can be a useful way of ensuring common
#' scales between different plots. See [expand_limits()] for
#' more details.
#'
#' @export
#' @inheritParams layer
#' @inheritParams geom_point
#' @examples
#' ggplot(mtcars, aes(wt, mpg))
#' # Nothing to see here!
geom_blank <- function(mapping = NULL, data = NULL,
stat = "identity", position = "identity",
...,
show.legend = NA,
inherit.aes = TRUE) {
layer(
data = data,
mapping = mapping,
stat = stat,
geom = GeomBlank,
position = position,
show.legend = show.legend,
inherit.aes = inherit.aes,
params = list(...),
check.aes = FALSE
)
}
#' @rdname ggplot2-ggproto
#' @format NULL
#' @usage NULL
#' @export
GeomBlank <- ggproto("GeomBlank", Geom,
default_aes = aes(),
handle_na = function(data, params) data,
draw_panel = function(...) nullGrob()
)