@@ -185,7 +185,7 @@ ggplot(data = gapminder, mapping = aes(x=year, y=lifeExp, color=continent)) +
185185 geom_line()
186186```
187187
188- <img src =" fig/08-plot-ggplot2-rendered-lifeExp-line-1.png " style =" display : block ; margin : auto ;" />
188+ <img src =" fig/08-plot-ggplot2-rendered-lifeExp-line-1.png " alt = " " style =" display : block ; margin : auto ;" />
189189
190190Instead of adding a ` geom_point ` layer, we've added a ` geom_line ` layer.
191191
@@ -197,7 +197,7 @@ ggplot(data = gapminder, mapping = aes(x=year, y=lifeExp, group=country, color=c
197197 geom_line()
198198```
199199
200- <img src =" fig/08-plot-ggplot2-rendered-lifeExp-line-by-1.png " style =" display : block ; margin : auto ;" />
200+ <img src =" fig/08-plot-ggplot2-rendered-lifeExp-line-by-1.png " alt = " " style =" display : block ; margin : auto ;" />
201201
202202We've added the ** group** * aesthetic* , which tells ` ggplot ` to draw a line for each
203203country.
@@ -211,7 +211,7 @@ ggplot(data = gapminder, mapping = aes(x=year, y=lifeExp, group=country, color=c
211211 geom_line() + geom_point()
212212```
213213
214- <img src =" fig/08-plot-ggplot2-rendered-lifeExp-line-point-1.png " style =" display : block ; margin : auto ;" />
214+ <img src =" fig/08-plot-ggplot2-rendered-lifeExp-line-point-1.png " alt = " " style =" display : block ; margin : auto ;" />
215215
216216It's important to note that each layer is drawn on top of the previous layer. In
217217this example, the points have been drawn * on top of* the lines. Here's a
@@ -223,7 +223,7 @@ ggplot(data = gapminder, mapping = aes(x=year, y=lifeExp, group=country)) +
223223 geom_line(mapping = aes(color = continent )) + geom_point()
224224```
225225
226- <img src =" fig/08-plot-ggplot2-rendered-lifeExp-layer-example-1-1.png " style =" display : block ; margin : auto ;" />
226+ <img src =" fig/08-plot-ggplot2-rendered-lifeExp-layer-example-1-1.png " alt = " " style =" display : block ; margin : auto ;" />
227227
228228In this example, the * aesthetic* mapping of ** color** has been moved from the
229229global plot options in ` ggplot ` to the ` geom_line ` layer so it no longer applies
@@ -275,7 +275,7 @@ ggplot(data = gapminder, mapping = aes(x = gdpPercap, y = lifeExp)) +
275275 geom_point()
276276```
277277
278- <img src =" fig/08-plot-ggplot2-rendered-lifeExp-vs-gdpPercap-scatter3-1.png " style =" display : block ; margin : auto ;" />
278+ <img src =" fig/08-plot-ggplot2-rendered-lifeExp-vs-gdpPercap-scatter3-1.png " alt = " " style =" display : block ; margin : auto ;" />
279279
280280Currently it's hard to see the relationship between the points due to some strong
281281outliers in GDP per capita. We can change the scale of units on the x axis using
@@ -404,7 +404,7 @@ ggplot(data = gapminder, mapping = aes(x = gdpPercap, y = lifeExp, color = conti
404404`geom_smooth()` using formula = 'y ~ x'
405405```
406406
407- <img src =" fig/08-plot-ggplot2-rendered-ch4b-sol-1.png " style =" display : block ; margin : auto ;" />
407+ <img src =" fig/08-plot-ggplot2-rendered-ch4b-sol-1.png " alt = " " style =" display : block ; margin : auto ;" />
408408
409409:::::::::::::::::::::::::
410410
@@ -438,7 +438,7 @@ ggplot(data = americas, mapping = aes(x = year, y = lifeExp)) +
438438 theme(axis.text.x = element_text(angle = 45 ))
439439```
440440
441- <img src =" fig/08-plot-ggplot2-rendered-facet-1.png " style =" display : block ; margin : auto ;" />
441+ <img src =" fig/08-plot-ggplot2-rendered-facet-1.png " alt = " " style =" display : block ; margin : auto ;" />
442442
443443The ` facet_wrap ` layer took a "formula" as its argument, denoted by the tilde
444444(~ ). This tells R to draw a panel for each unique value in the country column
@@ -470,7 +470,7 @@ ggplot(data = americas, mapping = aes(x = year, y = lifeExp, color=continent)) +
470470 theme(axis.text.x = element_text(angle = 90 , hjust = 1 ))
471471```
472472
473- <img src =" fig/08-plot-ggplot2-rendered-theme-1.png " style =" display : block ; margin : auto ;" />
473+ <img src =" fig/08-plot-ggplot2-rendered-theme-1.png " alt = " " style =" display : block ; margin : auto ;" />
474474
475475## Exporting the plot
476476
@@ -531,7 +531,7 @@ ggplot(data = gapminder, mapping = aes(x = continent, y = lifeExp, fill = contin
531531 axis.ticks.x = element_blank())
532532```
533533
534- <img src =" fig/08-plot-ggplot2-rendered-ch5-sol-1.png " style =" display : block ; margin : auto ;" />
534+ <img src =" fig/08-plot-ggplot2-rendered-ch5-sol-1.png " alt = " " style =" display : block ; margin : auto ;" />
535535
536536:::::::::::::::::::::::::
537537
0 commit comments