Skip to content

Commit d7aa7c4

Browse files
committed
revert
1 parent b7754c8 commit d7aa7c4

File tree

1 file changed

+14
-22
lines changed

1 file changed

+14
-22
lines changed

R/guide-legend.R

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
#' differently from the plot's theme settings. The `theme` argument in the
1818
#' guide overrides, and is combined with, the plot's theme.
1919
#' @param position A character string indicating where the legend should be
20-
#' placed relative to the plot panels, or a numeric value of length two
21-
#' setting the placement of legends.
20+
#' placed relative to the plot panels.
2221
#' @param direction A character string indicating the direction of the guide.
2322
#' One of "horizontal" or "vertical".
2423
#' @param override.aes A list specifying aesthetic parameters of legend key.
@@ -117,13 +116,7 @@ guide_legend <- function(
117116
theme <- deprecated_guide_args(theme, ...)
118117

119118
if (!is.null(position)) {
120-
if (is.numeric(position)) {
121-
if (length(position) != 2L) {
122-
cli::cli_abort("{.arg position} must be a numeric of length 2")
123-
}
124-
} else {
125-
position <- arg_match0(position, c(.trbl, "inside"))
126-
}
119+
position <- arg_match0(position, c(.trbl, "inside"))
127120
}
128121

129122
new_guide(
@@ -176,18 +169,18 @@ GuideLegend <- ggproto(
176169
hashables = exprs(title, key$.label, name),
177170

178171
elements = list(
179-
background = "legend.background",
180-
margin = "legend.margin",
181-
key = "legend.key",
182-
key_height = "legend.key.height",
183-
key_width = "legend.key.width",
184-
text = "legend.text",
185-
theme.title = "legend.title",
186-
spacing_x = "legend.key.spacing.x",
187-
spacing_y = "legend.key.spacing.y",
188-
text_position = "legend.text.position",
189-
title_position = "legend.title.position",
190-
byrow = "legend.byrow"
172+
background = "legend.background",
173+
margin = "legend.margin",
174+
key = "legend.key",
175+
key_height = "legend.key.height",
176+
key_width = "legend.key.width",
177+
text = "legend.text",
178+
theme.title = "legend.title",
179+
spacing_x = "legend.key.spacing.x",
180+
spacing_y = "legend.key.spacing.y",
181+
text_position = "legend.text.position",
182+
title_position = "legend.title.position",
183+
byrow = "legend.byrow"
191184
),
192185

193186
extract_params = function(scale, params,
@@ -569,7 +562,6 @@ GuideLegend <- ggproto(
569562
t = 1, r = -1, b = -1, l = 1, z = -Inf
570563
)
571564
}
572-
573565
gt
574566
}
575567
)

0 commit comments

Comments
 (0)