Skip to content

Commit 09b9020

Browse files
committed
Use coord_radial() in examples
1 parent 295f5cb commit 09b9020

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

R/coord-polar.R

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@
2323
#' # A pie chart = stacked bar chart + polar coordinates
2424
#' pie <- ggplot(mtcars, aes(x = factor(1), fill = factor(cyl))) +
2525
#' geom_bar(width = 1)
26-
#' pie + coord_polar(theta = "y")
26+
#' pie + coord_radial(theta = "y", expand = FALSE)
2727
#'
2828
#' \donttest{
2929
#'
3030
#' # A coxcomb plot = bar chart + polar coordinates
3131
#' cxc <- ggplot(mtcars, aes(x = factor(cyl))) +
3232
#' geom_bar(width = 1, colour = "black")
33-
#' cxc + coord_polar()
33+
#' cxc + coord_radial(expand = FALSE)
3434
#' # A new type of plot?
35-
#' cxc + coord_polar(theta = "y")
35+
#' cxc + coord_radial(theta = "y", expand = FALSE)
3636
#'
3737
#' # The bullseye chart
38-
#' pie + coord_polar()
38+
#' pie + coord_radial(expand = FALSE)
3939
#'
4040
#' # Hadley's favourite pie chart
4141
#' df <- data.frame(
@@ -45,7 +45,7 @@
4545
#' ggplot(df, aes(x = "", y = value, fill = variable)) +
4646
#' geom_col(width = 1) +
4747
#' scale_fill_manual(values = c("red", "yellow")) +
48-
#' coord_polar("y", start = pi / 3) +
48+
#' coord_radial("y", start = pi / 3, expand = FALSE) +
4949
#' labs(title = "Pac man")
5050
#'
5151
#' # Windrose + doughnut plot
@@ -56,9 +56,10 @@
5656
#' doh <- ggplot(movies, aes(x = rrating, fill = budgetq))
5757
#'
5858
#' # Wind rose
59-
#' doh + geom_bar(width = 1) + coord_polar()
59+
#' doh + geom_bar(width = 1) + coord_radial(expand = FALSE)
6060
#' # Race track plot
61-
#' doh + geom_bar(width = 0.9, position = "fill") + coord_polar(theta = "y")
61+
#' doh + geom_bar(width = 0.9, position = "fill") +
62+
#' coord_radial(theta = "y", expand = FALSE)
6263
#' }
6364
#' }
6465
coord_polar <- function(theta = "x", start = 0, direction = 1, clip = "on") {

man/coord_polar.Rd

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

0 commit comments

Comments
 (0)