From c67d5ed58c0fd54ecfa1900bb234f59a0aaa7f83 Mon Sep 17 00:00:00 2001 From: hadley Date: Wed, 17 Aug 2016 13:52:12 -0500 Subject: [PATCH] Default legend on the right --- communicate-plots.Rmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/communicate-plots.Rmd b/communicate-plots.Rmd index 889d357..2344dff 100644 --- a/communicate-plots.Rmd +++ b/communicate-plots.Rmd @@ -315,10 +315,10 @@ To control the overall position of the legend, you need to use a `theme()` setti base <- ggplot(mpg, aes(displ, hwy)) + geom_point(aes(colour = class)) -base + theme(legend.position = "left") # the default +base + theme(legend.position = "left") base + theme(legend.position = "top") base + theme(legend.position = "bottom") -base + theme(legend.position = "right") +base + theme(legend.position = "right") # the default ``` You can also use `legend.postion = "none"` to suppress the display of the legend altogether.