Skip to content

Commit 20cda7a

Browse files
committed
fixing plot sizes for bar plots in viz
1 parent 6e3d115 commit 20cda7a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

viz.Rmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ However, that will not work well for this particular visualization
724724
because the legend labels are quite long
725725
and would run off the page if displayed this way.
726726

727-
```{r 03-scatter-color-by-category-legend-edit, warning=FALSE, fig.height=5, fig.width = 6, fig.align = "center", 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 with the legend edited."}
727+
```{r 03-scatter-color-by-category-legend-edit, warning=FALSE, fig.height=5, fig.width = 5.5, fig.align = "center", 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 with the legend edited."}
728728
ggplot(can_lang, aes(x = most_at_home_percent,
729729
y = mother_tongue_percent,
730730
color = category)) +
@@ -770,7 +770,7 @@ this makes the scatter point shapes different for each category. This kind of
770770
visual redundancy—i.e., conveying the same information with both scatter point color and shape—can
771771
further improve the clarity and accessibility of your visualization.
772772

773-
```{r scatter-color-by-category-palette, fig.height=5, fig.width = 6, fig.align = "center", warning=FALSE, 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 with color-blind friendly colors."}
773+
```{r scatter-color-by-category-palette, fig.height=5, fig.width = 5.5, fig.align = "center", warning=FALSE, 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 with color-blind friendly colors."}
774774
ggplot(can_lang, aes(x = most_at_home_percent,
775775
y = mother_tongue_percent,
776776
color = category,
@@ -895,7 +895,7 @@ the landmass sizes. So we have to pass the `stat = "identity"` argument to `geom
895895
shown in Figure \@ref(fig:03-data-islands-bar).
896896
\index{ggplot!geom\_bar}
897897

898-
```{r 03-data-islands-bar, warning=FALSE, message=FALSE, fig.cap = "Bar plot of all Earth's landmasses' size with squished labels."}
898+
```{r 03-data-islands-bar, warning=FALSE, message=FALSE, fig.width=5, fig.height=4, fig.align = "center", fig.cap = "Bar plot of all Earth's landmasses' size with squished labels."}
899899
islands_bar <- ggplot(islands_df, aes(x = landmass, y = size)) +
900900
geom_bar(stat = "identity")
901901
@@ -914,7 +914,7 @@ space, we'll use horizontal bars instead of vertical ones. We do this by
914914
swapping the `x` and `y` variables:
915915
\index{slice\_max}
916916

917-
```{r 03-data-islands-bar-2, warning=FALSE, message=FALSE, fig.cap = "Bar plot of size for Earth's largest 12 landmasses."}
917+
```{r 03-data-islands-bar-2, warning=FALSE, message=FALSE, fig.width=5, fig.height=3, fig.align = "center", fig.cap = "Bar plot of size for Earth's largest 12 landmasses."}
918918
islands_top12 <- slice_max(islands_df, order_by = size, n = 12)
919919
islands_bar <- ggplot(islands_top12, aes(x = size, y = landmass)) +
920920
geom_bar(stat = "identity")
@@ -957,7 +957,7 @@ Thus we use the `fill` argument inside `labs` to change that to "Type."
957957
Finally, we again \index{ggplot!reorder} use the `theme` function
958958
to change the font size.
959959

960-
```{r 03-data-islands-bar-4, warning = FALSE, message = FALSE, fig.width = 8, fig.cap = "Bar plot of size for Earth's largest 12 landmasses colored by whether its a continent with clearer axes and labels."}
960+
```{r 03-data-islands-bar-4, warning = FALSE, message = FALSE, fig.width=8, fig.align="center", fig.cap = "Bar plot of size for Earth's largest 12 landmasses colored by whether its a continent with clearer axes and labels."}
961961
islands_bar <- ggplot(islands_top12,
962962
aes(x = size,
963963
y = fct_reorder(landmass, size, .desc = TRUE),

0 commit comments

Comments
 (0)