You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: viz.Rmd
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,7 @@ are as follows:
87
87
-**bar plots** visualize comparisons of amounts
88
88
-**histograms** visualize the distribution of one quantitative variable (i.e., all its possible values and how often they occur) \index{distribution}
89
89
90
-
```{r plot-sketches, echo = FALSE, fig.width = 4.6, fig.height = 4.75, fig.align = 'center', fig.cap = "Examples of scatter, line and bar plots, as well as histograms."}
90
+
```{r plot-sketches, echo = FALSE, fig.width = 4.5, fig.height = 4.65, fig.align = 'center', fig.cap = "Examples of scatter, line and bar plots, as well as histograms."}
@@ -505,7 +505,7 @@ We will begin with a scatter plot of the `mother_tongue` and `most_at_home` colu
505
505
The resulting plot is shown in Figure \@ref(fig:03-mother-tongue-vs-most-at-home).
506
506
\index{ggplot!geom\_point}
507
507
508
-
```{r 03-mother-tongue-vs-most-at-home, fig.height=5, warning=FALSE, fig.cap = "Scatter plot of number of Canadians reporting a language as their mother tongue vs the primary language at home."}
508
+
```{r 03-mother-tongue-vs-most-at-home, fig.height=5, fig.width = 4, warning=FALSE, fig.cap = "Scatter plot of number of Canadians reporting a language as their mother tongue vs the primary language at home."}
509
509
ggplot(can_lang, aes(x = most_at_home, y = mother_tongue)) +
510
510
geom_point()
511
511
```
@@ -519,7 +519,7 @@ make the axes labels on the plots more readable.
519
519
\index{escape character} We should also increase the font size to further
520
520
improve readability.
521
521
522
-
```{r 03-mother-tongue-vs-most-at-home-labs, fig.height=5, warning=FALSE, fig.cap = "Scatter plot of number of Canadians reporting a language as their mother tongue vs the primary language at home with x and y labels."}
522
+
```{r 03-mother-tongue-vs-most-at-home-labs, fig.height=5, fig.width = 4, warning=FALSE, fig.cap = "Scatter plot of number of Canadians reporting a language as their mother tongue vs the primary language at home with x and y labels."}
523
523
ggplot(can_lang, aes(x = most_at_home, y = mother_tongue)) +
524
524
geom_point() +
525
525
labs(x = "Language spoken most at home \n (number of Canadian residents)",
@@ -584,7 +584,7 @@ to put commas in these numbers to increase their readability.
584
584
We can do this in R by passing the `label_comma` function (from the `scales` package)
585
585
to the `labels` argument of the `scale_x_log10` and `scale_x_log10` functions.
586
586
587
-
```{r 03-mother-tongue-vs-most-at-home-scale, message = FALSE, warning = FALSE, fig.height=5, fig.cap = "Scatter plot of number of Canadians reporting a language as their mother tongue vs the primary language at home with log adjusted x and y axes."}
587
+
```{r 03-mother-tongue-vs-most-at-home-scale, message = FALSE, warning = FALSE, fig.height=5, fig.width = 4, fig.cap = "Scatter plot of number of Canadians reporting a language as their mother tongue vs the primary language at home with log adjusted x and y axes."}
588
588
library(scales)
589
589
590
590
ggplot(can_lang, aes(x = most_at_home, y = mother_tongue)) +
@@ -641,7 +641,7 @@ Finally, we will edit the visualization to use the percentages we just computed
```{r 03-mother-tongue-vs-most-at-home-scale-props, fig.height=5, warning=FALSE, fig.cap = "Scatter plot of percentage of Canadians reporting a language as their mother tongue vs the primary language at home."}
644
+
```{r 03-mother-tongue-vs-most-at-home-scale-props, fig.height=5, fig.width = 4, warning=FALSE, fig.cap = "Scatter plot of percentage of Canadians reporting a language as their mother tongue vs the primary language at home."}
645
645
ggplot(can_lang, aes(x = most_at_home_percent, y = mother_tongue_percent)) +
646
646
geom_point() +
647
647
labs(x = "Language spoken most at home \n (percentage of Canadian residents)",
@@ -698,7 +698,7 @@ that the `category` column should color the points. Adding this argument will
698
698
color the points according to their group and add a legend at the side of the
699
699
plot.
700
700
701
-
```{r 03-scatter-color-by-category, warning=FALSE, fig.height=5, fig.cap = "Scatter plot of percentage of Canadians reporting a language as their mother tongue vs the primary language at home colored by language category."}
701
+
```{r 03-scatter-color-by-category, warning=FALSE, fig.height=5, fig.width = 4, fig.cap = "Scatter plot of percentage of Canadians reporting a language as their mother tongue vs the primary language at home colored by language category."}
0 commit comments