Skip to content

Commit e20c388

Browse files
committed
fixing plot sizes
1 parent 2b92d15 commit e20c388

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

viz.Rmd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ are as follows:
8787
- **bar plots** visualize comparisons of amounts
8888
- **histograms** visualize the distribution of one quantitative variable (i.e., all its possible values and how often they occur) \index{distribution}
8989

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."}
9191
set.seed(1)
9292
9393
scatter_plot <- tibble(x = seq(0.25, 10, by = 0.5) + rnorm(20, 1, 1.5),
@@ -505,7 +505,7 @@ We will begin with a scatter plot of the `mother_tongue` and `most_at_home` colu
505505
The resulting plot is shown in Figure \@ref(fig:03-mother-tongue-vs-most-at-home).
506506
\index{ggplot!geom\_point}
507507

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."}
509509
ggplot(can_lang, aes(x = most_at_home, y = mother_tongue)) +
510510
geom_point()
511511
```
@@ -519,7 +519,7 @@ make the axes labels on the plots more readable.
519519
\index{escape character} We should also increase the font size to further
520520
improve readability.
521521

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."}
523523
ggplot(can_lang, aes(x = most_at_home, y = mother_tongue)) +
524524
geom_point() +
525525
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.
584584
We can do this in R by passing the `label_comma` function (from the `scales` package)
585585
to the `labels` argument of the `scale_x_log10` and `scale_x_log10` functions.
586586

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."}
588588
library(scales)
589589
590590
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
641641
units). Figure \@ref(fig:03-mother-tongue-vs-most-at-home-scale-props) displays
642642
the final result.
643643

644-
```{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."}
645645
ggplot(can_lang, aes(x = most_at_home_percent, y = mother_tongue_percent)) +
646646
geom_point() +
647647
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
698698
color the points according to their group and add a legend at the side of the
699699
plot.
700700

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."}
702702
ggplot(can_lang, aes(x = most_at_home_percent,
703703
y = mother_tongue_percent,
704704
color = category)) +

0 commit comments

Comments
 (0)