Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The type of line (solid, dashed, dotted, etc.) is set with
linetype, the thickness (in mm) with
size, and the color of the line with colour.
These properties can be set (as shown in Figure 4-11) by passing them values
in the call to geom_line():
ggplot(BOD,aes(x=Time,y=demand))+geom_line(linetype="dashed",size=1,colour="blue")
If there is more than one line, setting the aesthetic
properties will affect all of the lines. On the other hand,
mapping variables to the properties, as we saw in
Making a Line Graph with Multiple Lines, will result in each
line looking different. The default colors aren’t the most appealing, so
you may want to use a different palette, as shown in Figure 4-12, by using scale_colour_brewer() or scale_colour_manual():