Skip to content

Commit 659ee46

Browse files
committed
changing size of axes in regression1
1 parent c8ce62c commit 659ee46

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

regression1.Rmd

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ print_tidymodels <- function(tidymodels_object) {
2424
}
2525
}
2626
}
27-
theme_update(axis.title = element_text(size = 14)) # modify axis label size in plots
27+
theme_update(axis.title = element_text(size = 12)) # modify axis label size in plots
2828
```
2929

3030
## Overview
@@ -150,7 +150,7 @@ eda <- ggplot(sacramento, aes(x = sqft, y = price)) +
150150
xlab("House size (square feet)") +
151151
ylab("Price (USD)") +
152152
scale_y_continuous(labels = dollar_format()) +
153-
theme(text = element_text(size = 14))
153+
theme(text = element_text(size = 12))
154154
155155
eda
156156
```
@@ -206,7 +206,7 @@ small_plot <- ggplot(small_sacramento, aes(x = sqft, y = price)) +
206206
ylab("Price (USD)") +
207207
scale_y_continuous(labels = dollar_format()) +
208208
geom_vline(xintercept = 2000, linetype = "dotted") +
209-
theme(text = element_text(size = 14))
209+
theme(text = element_text(size = 12))
210210
211211
small_plot
212212
```
@@ -525,8 +525,8 @@ for (i in 1:6) {
525525
scale_y_continuous(labels = dollar_format()) +
526526
geom_line(data = sacr_preds, aes(x = sqft, y = .pred), color = "blue") +
527527
ggtitle(paste0("K = ", gridvals[[i]])) +
528-
theme(text = element_text(size = 16))
529-
} else {
528+
theme(text = element_text(size = 20), axis.title=element_text(size=20))
529+
} else {
530530
plots[[i]] <- ggplot(sacr_preds, aes(x = sqft, y = price)) +
531531
geom_point(alpha = 0.4) +
532532
xlab("House size (square feet)") +
@@ -537,7 +537,7 @@ for (i in 1:6) {
537537
yintercept = mean(sacr_preds$price),
538538
color = "blue") +
539539
ggtitle(paste0("K = ", gridvals[[i]])) +
540-
theme(text = element_text(size = 16))
540+
theme(text = element_text(size = 20), axis.title=element_text(size=20))
541541
}
542542
}
543543
@@ -661,7 +661,7 @@ plot_final <- ggplot(sacramento_train, aes(x = sqft, y = price)) +
661661
ylab("Price (USD)") +
662662
scale_y_continuous(labels = dollar_format()) +
663663
ggtitle(paste0("K = ", kmin)) +
664-
theme(text = element_text(size = 14))
664+
theme(text = element_text(size = 12))
665665
666666
plot_final
667667
```
@@ -698,7 +698,7 @@ plot_beds <- sacramento |>
698698
ggplot(aes(x = beds, y = price)) +
699699
geom_point(alpha = 0.4) +
700700
labs(x = 'Number of Bedrooms', y = 'Price (USD)') +
701-
theme(text = element_text(size = 14))
701+
theme(text = element_text(size = 12))
702702
703703
plot_beds
704704
```

0 commit comments

Comments
 (0)