Skip to content

Commit 29ef8bf

Browse files
landmass bar colors steelblue,darkorange
1 parent 6c81a90 commit 29ef8bf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

source/viz.Rmd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,9 @@ coloring the bars based on whether they correspond to a continent,
954954
and by organizing the bars by landmass size rather than by alphabetical order.
955955
The data for coloring the bars is stored in the `landmass_type` column,
956956
so we add the `fill` argument to the aesthetic mapping
957-
and set it to `landmass_type`.
957+
and set it to `landmass_type`. We manually select two colors for the bars
958+
using the `scale_fill_manual` function:`"darkorange"`
959+
for orange and `"steelblue"` for blue.
958960
To organize the landmasses by their `size` variable,
959961
we will use the `tidyverse` `fct_reorder` function
960962
in the aesthetic mapping to organize the landmasses by their `size` variable.
@@ -992,6 +994,7 @@ islands_bar <- ggplot(islands_top12,
992994
y = "Landmass",
993995
fill = "Type",
994996
title = "Earth's twelve largest landmasses") +
997+
scale_fill_manual(values = c("steelblue", "darkorange")) +
995998
theme(text = element_text(size = 10))
996999
9971000
islands_bar

0 commit comments

Comments
 (0)