Skip to content

Commit fc4fe67

Browse files
committed
renmae xlim and ylim to thetalim and rlim respectively
1 parent d55656d commit fc4fe67

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

R/coord-radial.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#' @param end Position from 12 o'clock in radians where plot ends, to allow
55
#' for partial polar coordinates. The default, `NULL`, is set to
66
#' `start + 2 * pi`.
7-
#' @inheritParams coord_cartesian
7+
#' @param thetalim,rlim Limits for the theta and r axes.
88
#' @param expand If `TRUE`, the default, adds a small expansion factor to
99
#' the limits to prevent overlap between data and axes. If `FALSE`, limits
1010
#' are taken directly from the scale.
@@ -49,13 +49,13 @@
4949
#' coord_radial(
5050
#' start = -0.4 * pi,
5151
#' end = 0.4 * pi, inner.radius = 0.3,
52-
#' xlim = c(200, 300),
53-
#' ylim = c(15, 30),
52+
#' thetalim = c(200, 300),
53+
#' rlim = c(15, 30),
5454
#' clip = "on"
5555
#' )
5656
coord_radial <- function(theta = "x",
5757
start = 0, end = NULL,
58-
xlim = NULL, ylim = NULL, expand = TRUE,
58+
thetalim = NULL, rlim = NULL, expand = TRUE,
5959
direction = deprecated(),
6060
clip = "off",
6161
r.axis.inside = NULL,
@@ -109,7 +109,7 @@ coord_radial <- function(theta = "x",
109109
inner.radius <- switch(reverse, thetar = , r = rev, identity)(inner.radius)
110110

111111
ggproto(NULL, CoordRadial,
112-
limits = list(x = xlim, y = ylim),
112+
limits = list(theta = thetalim, r = rlim),
113113
theta = theta,
114114
r = r,
115115
arc = arc,
@@ -163,10 +163,10 @@ CoordRadial <- ggproto("CoordRadial", Coord,
163163
setup_panel_params = function(self, scale_x, scale_y, params = list()) {
164164

165165
params <- c(
166-
view_scales_polar(scale_x, self$theta, self$limits$x,
166+
view_scales_polar(scale_x, self$theta, self$limits$theta,
167167
expand = params$expand[c(4, 2)]
168168
),
169-
view_scales_polar(scale_y, self$theta, self$limits$y,
169+
view_scales_polar(scale_y, self$theta, self$limits$r,
170170
expand = params$expand[c(3, 1)]
171171
),
172172
list(bbox = polar_bbox(self$arc, inner_radius = self$inner_radius),

man/coord_polar.Rd

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)