Some more x and y

This commit is contained in:
mine-cetinkaya-rundel 2022-12-05 06:39:35 -05:00
parent e19dd4c63f
commit b9a21fd23f
1 changed files with 3 additions and 3 deletions

View File

@ -256,7 +256,7 @@ flights |>
group_by(hour = sched_dep_time %/% 100) |>
summarize(prop_cancelled = mean(is.na(dep_time)), n = n()) |>
filter(hour > 1) |>
ggplot(aes(hour, prop_cancelled)) +
ggplot(aes(x = hour, y = prop_cancelled)) +
geom_line(color = "grey50") +
geom_point(aes(size = n))
```
@ -281,14 +281,14 @@ money <- tibble(
If you plot this data, you'll get an exponential curve showing how your money grows year by year at an interest rate of 1.05:
```{r}
ggplot(money, aes(year, money)) +
ggplot(money, aes(x = year, y = money)) +
geom_line()
```
Log transforming the y-axis gives a straight line:
```{r}
ggplot(money, aes(year, money)) +
ggplot(money, aes(x = year, y = money)) +
geom_line() +
scale_y_log10()
```