Graphics Reference
In-Depth Information
Figure 4-18. Graph with a semitransparent shaded area and an outline
Having an outline around the entire area might not be desirable, because it puts a vertical line at
the beginning and end of the shaded area, as well as one along the bottom. To avoid this issue, we
can draw the area without an outline (by not specifying colour ), and then layer a geom_line()
on top, as shown in Figure 4-19 :
ggplot(sunspotyear, aes(x = Year, y = Sunspots)) +
geom_area(fill = "blue" , alpha = .2 ) +
geom_line()
Figure 4-19. Line graph with a line just on top, using geom_line()
See Also
See Chapter 12 for more on choosing colors.
Making a Stacked Area Graph
Problem
You want to make a stacked area graph.
Search WWH ::




Custom Search