Skip to content

Commit 01cb06a

Browse files
committed
increasing plot font sizes for clustering
1 parent ed6f81f commit 01cb06a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

clustering.Rmd

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ knitr::opts_chunk$set(warning = FALSE, fig.align = "default")
1616
# some graphs with the code shown to students are hard coded
1717
cbbPalette <- c(brewer.pal(9, "Paired"))
1818
cbpalette <- c("darkorange3", "dodgerblue3", "goldenrod1")
19+
20+
theme_update(axis.title = element_text(size = 14)) # modify axis label size in plots
1921
```
2022

2123
## Overview
@@ -171,7 +173,8 @@ ggplot(data, aes(x = flipper_length_standardized,
171173
y = bill_length_standardized)) +
172174
geom_point() +
173175
xlab("Flipper Length (standardized)") +
174-
ylab("Bill Length (standardized)")
176+
ylab("Bill Length (standardized)") +
177+
theme(text = element_text(size = 14))
175178
```
176179

177180
Based \index{ggplot}\index{ggplot!geom\_point} on the visualization
@@ -938,7 +941,8 @@ cluster_plot <- ggplot(clustered_data,
938941
color = "Cluster") +
939942
scale_color_manual(values = c("dodgerblue3",
940943
"darkorange3",
941-
"goldenrod1"))
944+
"goldenrod1")) +
945+
theme(text = element_text(size = 14))
942946
943947
cluster_plot
944948
```
@@ -1040,7 +1044,8 @@ elbow_plot <- ggplot(clustering_statistics, aes(x = k, y = tot.withinss)) +
10401044
geom_line() +
10411045
xlab("K") +
10421046
ylab("Total within-cluster sum of squares") +
1043-
scale_x_continuous(breaks = 1:9)
1047+
scale_x_continuous(breaks = 1:9) +
1048+
theme(text = element_text(size = 14))
10441049
10451050
elbow_plot
10461051
```
@@ -1082,7 +1087,8 @@ elbow_plot <- ggplot(clustering_statistics, aes(x = k, y = tot.withinss)) +
10821087
geom_line() +
10831088
xlab("K") +
10841089
ylab("Total within-cluster sum of squares") +
1085-
scale_x_continuous(breaks = 1:9)
1090+
scale_x_continuous(breaks = 1:9) +
1091+
theme(text = element_text(size = 14))
10861092
10871093
elbow_plot
10881094
```

0 commit comments

Comments
 (0)