File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 44
44
# ' p + theme(legend.position = "bottom", legend.box = "horizontal")
45
45
# '
46
46
# ' # Set order for multiple guides
47
- # '
48
47
# ' ggplot(mpg, aes(displ, cty)) +
49
48
# ' 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
+ # ' )
53
54
# ' }
54
55
guides <- function (... ) {
55
56
args <- list (... )
Original file line number Diff line number Diff line change @@ -53,12 +53,13 @@ p + theme(legend.position = "bottom")
53
53
p + theme(legend.position = " bottom" , legend.box = " horizontal" )
54
54
55
55
# Set order for multiple guides
56
-
57
56
ggplot(mpg , aes(displ , cty )) +
58
57
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
+ )
62
63
}
63
64
}
64
65
\seealso {
You can’t perform that action at this time.
0 commit comments