Skip to content

Commit ed6f81f

Browse files
committed
changing plot font size in classification2
1 parent 859e719 commit ed6f81f

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

classification2.Rmd

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ library(gridExtra)
55
library(cowplot)
66
library(stringr)
77
library(knitr)
8+
library(ggplot2)
89
910
knitr::opts_chunk$set(fig.align = "center")
1011
@@ -24,6 +25,9 @@ print_tidymodels <- function(tidymodels_object) {
2425
}
2526
}
2627
}
28+
29+
theme_update(axis.title = element_text(size = 14)) # modify axis label size in plots
30+
2731
```
2832

2933
## Overview
@@ -227,7 +231,8 @@ perim_concav <- cancer |>
227231
geom_point(alpha = 0.5) +
228232
labs(color = "Diagnosis") +
229233
scale_color_manual(labels = c("Malignant", "Benign"),
230-
values = c("orange2", "steelblue2"))
234+
values = c("orange2", "steelblue2")) +
235+
theme(text = element_text(size = 14))
231236
232237
perim_concav
233238
```
@@ -782,7 +787,8 @@ as shown in Figure \@ref(fig:06-find-k).
782787
accuracy_vs_k <- ggplot(accuracies, aes(x = neighbors, y = mean)) +
783788
geom_point() +
784789
geom_line() +
785-
labs(x = "Neighbors", y = "Accuracy Estimate")
790+
labs(x = "Neighbors", y = "Accuracy Estimate") +
791+
theme(text = element_text(size = 14))
786792
787793
accuracy_vs_k
788794
```
@@ -839,7 +845,8 @@ accuracies <- knn_results |>
839845
accuracy_vs_k_lots <- ggplot(accuracies, aes(x = neighbors, y = mean)) +
840846
geom_point() +
841847
geom_line() +
842-
labs(x = "Neighbors", y = "Accuracy Estimate")
848+
labs(x = "Neighbors", y = "Accuracy Estimate") +
849+
theme(text = element_text(size = 14))
843850
844851
accuracy_vs_k_lots
845852
```

0 commit comments

Comments
 (0)