Skip to content

Commit f9a3e40

Browse files
committed
Guides doc tweak. Fixes #1004
1 parent 62d5069 commit f9a3e40

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

R/guides-.r

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@
4444
#' p + theme(legend.position = "bottom", legend.box = "horizontal")
4545
#'
4646
#' # Set order for multiple guides
47-
#'
4847
#' ggplot(mpg, aes(displ, cty)) +
4948
#' geom_point(aes(size = hwy, colour = cyl, shape = drv)) +
50-
#' guides(colour = guide_colourbar(order = 1),
51-
#' alpha = guide_legend(order = 2),
52-
#' size = guide_legend(order = 3))
49+
#' guides(
50+
#' colour = guide_colourbar(order = 1),
51+
#' shape = guide_legend(order = 2),
52+
#' size = guide_legend(order = 3)
53+
#' )
5354
#' }
5455
guides <- function(...) {
5556
args <- list(...)

man/guides.Rd

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,13 @@ p + theme(legend.position = "bottom")
5353
p + theme(legend.position = "bottom", legend.box = "horizontal")
5454

5555
# Set order for multiple guides
56-
5756
ggplot(mpg, aes(displ, cty)) +
5857
geom_point(aes(size = hwy, colour = cyl, shape = drv)) +
59-
guides(colour = guide_colourbar(order = 1),
60-
alpha = guide_legend(order = 2),
61-
size = guide_legend(order = 3))
58+
guides(
59+
colour = guide_colourbar(order = 1),
60+
shape = guide_legend(order = 2),
61+
size = guide_legend(order = 3)
62+
)
6263
}
6364
}
6465
\seealso{

0 commit comments

Comments
 (0)