Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
If you want to set the
shape of all the points (Figure 5-6), specify
the shape in geom_point():
library(gcookbook)# For the data setggplot(heightweight,aes(x=ageYear,y=heightIn))+geom_point(shape=3)
If you have mapped a variable to shape, use scale_shape_manual() to change the
shapes:
# Use slightly larger points and use a shape scale with custom valuesggplot(heightweight,aes(x=ageYear,y=heightIn,shape=sex))+geom_point(size=3)+scale_shape_manual(values=c(1,4))