@@ -24,6 +24,7 @@ print_tidymodels <- function(tidymodels_object) {
24
24
}
25
25
}
26
26
}
27
+ theme_update(axis.title = element_text(size = 14)) # modify axis label size in plots
27
28
```
28
29
29
30
## Overview
@@ -148,7 +149,8 @@ eda <- ggplot(sacramento, aes(x = sqft, y = price)) +
148
149
geom_point(alpha = 0.4) +
149
150
xlab("House size (square feet)") +
150
151
ylab("Price (USD)") +
151
- scale_y_continuous(labels = dollar_format())
152
+ scale_y_continuous(labels = dollar_format()) +
153
+ theme(text = element_text(size = 14))
152
154
153
155
eda
154
156
```
@@ -203,7 +205,8 @@ small_plot <- ggplot(small_sacramento, aes(x = sqft, y = price)) +
203
205
xlab("House size (square feet)") +
204
206
ylab("Price (USD)") +
205
207
scale_y_continuous(labels = dollar_format()) +
206
- geom_vline(xintercept = 2000, linetype = "dotted")
208
+ geom_vline(xintercept = 2000, linetype = "dotted") +
209
+ theme(text = element_text(size = 14))
207
210
208
211
small_plot
209
212
```
@@ -657,7 +660,8 @@ plot_final <- ggplot(sacramento_train, aes(x = sqft, y = price)) +
657
660
xlab("House size (square feet)") +
658
661
ylab("Price (USD)") +
659
662
scale_y_continuous(labels = dollar_format()) +
660
- ggtitle(paste0("K = ", kmin))
663
+ ggtitle(paste0("K = ", kmin)) +
664
+ theme(text = element_text(size = 14))
661
665
662
666
plot_final
663
667
```
@@ -691,9 +695,11 @@ to help predict the sale price of a house.
691
695
692
696
``` {r 07-bedscatter, fig.height = 3.5, fig.width = 4.5, fig.cap = "Scatter plot of the sale price of houses versus the number of bedrooms."}
693
697
plot_beds <- sacramento |>
694
- ggplot(aes(x = beds, y = price)) +
695
- geom_point(alpha = 0.4) +
696
- labs(x = 'Number of Bedrooms', y = 'Price (USD)')
698
+ ggplot(aes(x = beds, y = price)) +
699
+ geom_point(alpha = 0.4) +
700
+ labs(x = 'Number of Bedrooms', y = 'Price (USD)') +
701
+ theme(text = element_text(size = 14))
702
+
697
703
plot_beds
698
704
```
699
705
0 commit comments