File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -954,7 +954,9 @@ coloring the bars based on whether they correspond to a continent,
954
954
and by organizing the bars by landmass size rather than by alphabetical order.
955
955
The data for coloring the bars is stored in the ` landmass_type ` column,
956
956
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.
958
960
To organize the landmasses by their ` size ` variable,
959
961
we will use the ` tidyverse ` ` fct_reorder ` function
960
962
in the aesthetic mapping to organize the landmasses by their ` size ` variable.
@@ -992,6 +994,7 @@ islands_bar <- ggplot(islands_top12,
992
994
y = "Landmass",
993
995
fill = "Type",
994
996
title = "Earth's twelve largest landmasses") +
997
+ scale_fill_manual(values = c("steelblue", "darkorange")) +
995
998
theme(text = element_text(size = 10))
996
999
997
1000
islands_bar
You can’t perform that action at this time.
0 commit comments