Graphics Reference
In-Depth Information
Figure 10-15. Left: a variable mapped to shape and colour; middle: with new labels for shape;
right: with new labels for both shape and colour
Other commonly used scales with legends include:
scale_fill_discrete()
scale_fill_hue()
scale_fill_manual()
scale_fill_grey()
scale_fill_brewer()
scale_colour_discrete()
scale_colour_hue()
scale_colour_manual()
scale_colour_grey()
scale_colour_brewer()
scale_shape_manual()
scale_linetype()
By default, using scale_fill_discrete() is equivalent to using scale_fill_hue() ; the
same is true for color scales.
Changing the Appearance of Legend Labels
Problem
You want to change the appearance of labels in a legend.
Solution
Use theme(legend.text=element_text()) ( Figure 10-16 ):
Search WWH ::




Custom Search