Graphics Reference
In-Depth Information
and setting the labels works the same way. For example, to produce the graph on the right in
Figure 10-13 :
p + scale_fill_grey(start = .5 , end = 1 ,
labels = c( "Control" , "Treatment 1" , "Treatment 2" ))
If you are also changing the order of items in the legend, the labels are matched to the items by
position. In this example we'll change the item order, and make sure to set the labels in the same
order ( Figure 10-14 ):
p + scale_fill_discrete(limits = c( "trt1" , "trt2" , "ctrl" ),
labels = c( "Treatment 1" , "Treatment 2" , "Control" ))
Search WWH ::




Custom Search