Skip to content

Commit 6c81a90

Browse files
orange2 -> darkorange; steelblue2 -> steelblue
1 parent c737dff commit 6c81a90

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

source/classification1.Rmd

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ cancer |>
239239

240240
Next, let's draw a scatter plot \index{visualization!scatter} to visualize the relationship between the
241241
perimeter and concavity variables. Rather than use `ggplot's` default palette,
242-
we select our own colorblind-friendly colors—`"orange2"`
243-
for light orange and `"steelblue2"` for light blue—and
242+
we select our own colorblind-friendly colors—`"darkorange"`
243+
for orange and `"steelblue"` for blue—and
244244
pass them as the `values` argument to the `scale_color_manual` function.
245245

246246
```{r 05-scatter, fig.height = 3.5, fig.width = 4.5, fig.cap= "Scatter plot of concavity versus perimeter colored by diagnosis label."}
@@ -250,7 +250,7 @@ perim_concav <- cancer |>
250250
labs(x = "Perimeter (standardized)",
251251
y = "Concavity (standardized)",
252252
color = "Diagnosis") +
253-
scale_color_manual(values = c("orange2", "steelblue2")) +
253+
scale_color_manual(values = c("darkorange", "steelblue")) +
254254
theme(text = element_text(size = 12))
255255
perim_concav
256256
```
@@ -334,7 +334,7 @@ perim_concav_with_new_point <- bind_rows(cancer,
334334
labs(color = "Diagnosis", x = "Perimeter (standardized)",
335335
y = "Concavity (standardized)") +
336336
scale_color_manual(name = "Diagnosis",
337-
values = c("steelblue2", "orange2", "red")) +
337+
values = c("steelblue", "darkorange", "red")) +
338338
scale_shape_manual(name = "Diagnosis",
339339
values= c(16, 16, 18))+
340340
scale_size_manual(name = "Diagnosis",
@@ -389,7 +389,7 @@ perim_concav_with_new_point2 <- bind_rows(cancer,
389389
x = "Perimeter (standardized)",
390390
y = "Concavity (standardized)") +
391391
scale_color_manual(name = "Diagnosis",
392-
values = c("steelblue2", "orange2", "red")) +
392+
values = c("steelblue", "darkorange", "red")) +
393393
scale_shape_manual(name = "Diagnosis",
394394
values= c(16, 16, 18))+
395395
scale_size_manual(name = "Diagnosis",
@@ -484,7 +484,7 @@ perim_concav <- bind_rows(cancer,
484484
breaks = seq(-2, 4, 1)) +
485485
labs(color = "Diagnosis") +
486486
scale_color_manual(name = "Diagnosis",
487-
values = c("steelblue2", "orange2", "red")) +
487+
values = c("steelblue", "darkorange", "red")) +
488488
scale_shape_manual(name = "Diagnosis",
489489
values= c(16, 16, 18))+
490490
scale_size_manual(name = "Diagnosis",
@@ -628,7 +628,7 @@ plot_3d <- scaled_cancer_3 |>
628628
color = ~Class,
629629
opacity = 0.4,
630630
size = 2,
631-
colors = c("steelblue2", "orange2", "red"),
631+
colors = c("steelblue", "darkorange", "red"),
632632
symbol = ~Class, symbols = c('circle','circle','diamond'))
633633
634634
x1 <- c(pull(new_obs_3[1]), data$Perimeter[1])
@@ -653,15 +653,15 @@ z5 <- c(pull(new_obs_3[3]), data$Symmetry[5])
653653
654654
plot_3d <- plot_3d |>
655655
add_trace(x = x1, y = y1, z = z1, type = "scatter3d", mode = "lines",
656-
name = "lines", showlegend = FALSE, color = I("orange2")) |>
656+
name = "lines", showlegend = FALSE, color = I("darkorange")) |>
657657
add_trace(x = x2, y = y2, z = z2, type = "scatter3d", mode = "lines",
658-
name = "lines", showlegend = FALSE, color = I("orange2")) |>
658+
name = "lines", showlegend = FALSE, color = I("darkorange")) |>
659659
add_trace(x = x3, y = y3, z = z3, type = "scatter3d", mode = "lines",
660-
name = "lines", showlegend = FALSE, color = I("orange2")) |>
660+
name = "lines", showlegend = FALSE, color = I("darkorange")) |>
661661
add_trace(x = x4, y = y4, z = z4, type = "scatter3d", mode = "lines",
662-
name = "lines", showlegend = FALSE, color = I("steelblue2")) |>
662+
name = "lines", showlegend = FALSE, color = I("steelblue")) |>
663663
add_trace(x = x5, y = y5, z = z5, type = "scatter3d", mode = "lines",
664-
name = "lines", showlegend = FALSE, color = I("orange2"))
664+
name = "lines", showlegend = FALSE, color = I("darkorange"))
665665
666666
if(!is_latex_output()){
667667
plot_3d
@@ -966,7 +966,7 @@ unscaled <- ggplot(unscaled_cancer, aes(x = Area,
966966
shape = Class, size = Class)) +
967967
geom_point(alpha = 0.6) +
968968
scale_color_manual(name = "Diagnosis",
969-
values = c("steelblue2", "orange2", "red")) +
969+
values = c("steelblue", "darkorange", "red")) +
970970
scale_shape_manual(name = "Diagnosis",
971971
values= c(16, 16, 18)) +
972972
scale_size_manual(name = "Diagnosis",
@@ -1006,7 +1006,7 @@ scaled <- ggplot(scaled_cancer, aes(x = Area,
10061006
size = Class)) +
10071007
geom_point(alpha = 0.6) +
10081008
scale_color_manual(name = "Diagnosis",
1009-
values = c("steelblue2", "orange2", "red")) +
1009+
values = c("steelblue", "darkorange", "red")) +
10101010
scale_shape_manual(name = "Diagnosis",
10111011
values= c(16, 16, 18)) +
10121012
scale_size_manual(name = "Diagnosis",
@@ -1043,7 +1043,7 @@ ggplot(unscaled_cancer, aes(x = Area,
10431043
shape = Class)) +
10441044
geom_point(size = 2.5, alpha = 0.6) +
10451045
scale_color_manual(name = "Diagnosis",
1046-
values = c("steelblue2", "orange2", "red")) +
1046+
values = c("steelblue", "darkorange", "red")) +
10471047
scale_shape_manual(name = "Diagnosis",
10481048
values= c(16, 16, 18)) +
10491049
scale_size_manual(name = "Diagnosis",
@@ -1115,7 +1115,7 @@ rare_plot <- rare_cancer |>
11151115
labs(x = "Perimeter (standardized)",
11161116
y = "Concavity (standardized)",
11171117
color = "Diagnosis") +
1118-
scale_color_manual(values = c("orange2", "steelblue2")) +
1118+
scale_color_manual(values = c("darkorange", "steelblue")) +
11191119
theme(text = element_text(size = 12))
11201120
11211121
rare_plot
@@ -1148,16 +1148,16 @@ rare_plot <- bind_rows(rare_cancer,
11481148
x = "Perimeter (standardized)",
11491149
y = "Concavity (standardized)") +
11501150
scale_color_manual(name = "Diagnosis",
1151-
values = c("steelblue2", "orange2", "red")) +
1151+
values = c("steelblue", "darkorange", "red")) +
11521152
scale_shape_manual(name = "Diagnosis",
11531153
values= c(16, 16, 18))+
11541154
scale_size_manual(name = "Diagnosis",
11551155
values= c(2, 2, 2.5))
11561156
11571157
for (i in 1:7) {
1158-
clr <- "steelblue2"
1158+
clr <- "steelblue"
11591159
if (neighbors$Class[i] == "Malignant") {
1160-
clr <- "orange2"
1160+
clr <- "darkorange"
11611161
}
11621162
rare_plot <- rare_plot +
11631163
geom_segment(
@@ -1217,7 +1217,7 @@ rare_plot <-
12171217
labs(color = "Diagnosis",
12181218
x = "Perimeter (standardized)",
12191219
y = "Concavity (standardized)") +
1220-
scale_color_manual(values = c("orange2", "steelblue2"))
1220+
scale_color_manual(values = c("darkorange", "steelblue"))
12211221
12221222
rare_plot
12231223
```
@@ -1288,7 +1288,7 @@ upsampled_plot <-
12881288
labs(color = "Diagnosis",
12891289
x = "Perimeter (standardized)",
12901290
y = "Concavity (standardized)") +
1291-
scale_color_manual(values = c("orange2", "steelblue2"))
1291+
scale_color_manual(values = c("darkorange", "steelblue"))
12921292
12931293
upsampled_plot
12941294
```
@@ -1492,7 +1492,7 @@ wkflw_plot <-
14921492
labs(color = "Diagnosis",
14931493
x = "Area",
14941494
y = "Smoothness") +
1495-
scale_color_manual(values = c("orange2", "steelblue2")) +
1495+
scale_color_manual(values = c("darkorange", "steelblue")) +
14961496
theme(text = element_text(size = 12))
14971497
14981498
wkflw_plot

source/classification2.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ perim_concav <- cancer |>
343343
ggplot(aes(x = Smoothness, y = Concavity, color = Class)) +
344344
geom_point(alpha = 0.5) +
345345
labs(color = "Diagnosis") +
346-
scale_color_manual(values = c("orange2", "steelblue2")) +
346+
scale_color_manual(values = c("darkorange", "steelblue")) +
347347
theme(text = element_text(size = 12))
348348
349349
perim_concav
@@ -1137,7 +1137,7 @@ for (i in 1:length(ks)) {
11371137
size = 5.) +
11381138
labs(color = "Diagnosis") +
11391139
ggtitle(paste("K = ", ks[[i]])) +
1140-
scale_color_manual(values = c("orange2", "steelblue2")) +
1140+
scale_color_manual(values = c("darkorange", "steelblue")) +
11411141
theme(text = element_text(size = 18), axis.title=element_text(size=18))
11421142
}
11431143

0 commit comments

Comments
 (0)