Save plots and add to readme automatically.

This commit is contained in:
mattbk 2024-01-09 20:48:08 -06:00
parent 590786aa18
commit 386192d752
6 changed files with 25 additions and 8 deletions

View File

@ -13,3 +13,9 @@ I'll get a blog post up at https://w1cdn.net at some point.
- Main page: http://ah0a.org/FCC/index.html
- FCC numbers as images of tables: https://sites.google.com/site/amateurradiodata/home
- K8VSY's per capita estimates: https://k8vsy.radio/2021/09/ham-radio-licenses-us-states-per-capita.html
# Rough Plots
![Alt text](plots/total-over-time-y.png)
![Alt text](plots/total-over-time.png)
![Alt text](plots/class-over-time.png)
![Alt text](plots/class-over-time-stacked.png)

View File

@ -27,7 +27,6 @@ d_total_long <- d_total %>%
names_to = "lclass",
values_to = "count")
#### Plots ####
##### Total over time #####
ggplot(data = d_total,
@ -35,7 +34,7 @@ ggplot(data = d_total,
y = Total,
color = source_name)) +
geom_line() +
geom_point() +
geom_point(size = 0.3) +
scale_x_date(date_breaks = "10 years",
date_minor_breaks = "1 year",
date_labels = "%Y") +
@ -44,7 +43,10 @@ ggplot(data = d_total,
labs(title = "US Amateur Licenses",
subtitle = "ARRL, AH0A",
caption = "w1cdn.net",
color = "Source")
color = "Source") +
theme(legend.position="bottom")
ggsave("plots/total-over-time.png", width = 6, height = 4)
##### Total over time, y = 0 #####
ggplot(data = d_total,
@ -52,7 +54,7 @@ ggplot(data = d_total,
y = Total,
color = source_name)) +
geom_line() +
geom_point() +
geom_point(size = 0.3) +
scale_x_date(date_breaks = "10 years",
date_minor_breaks = "1 year",
date_labels = "%Y") +
@ -62,7 +64,10 @@ ggplot(data = d_total,
labs(title = "US Amateur Licenses",
subtitle = "ARRL, AH0A",
caption = "w1cdn.net",
color = "Source")
color = "Source") +
theme(legend.position="bottom")
ggsave("plots/total-over-time-y.png", width = 6, height = 4)
##### By license class #####
ggplot(data = d_total_long %>% filter(lclass != "Total"),
@ -70,7 +75,7 @@ ggplot(data = d_total_long %>% filter(lclass != "Total"),
y = count,
color = fct_reorder2(lclass, Date, count))) +
geom_line() +
geom_point() +
geom_point(size = 0.3) +
scale_x_date(date_breaks = "10 years",
date_minor_breaks = "1 year",
date_labels = "%Y") +
@ -81,7 +86,10 @@ ggplot(data = d_total_long %>% filter(lclass != "Total"),
subtitle = "ARRL, AH0A",
y = "Count",
color = "Class",
caption = "w1cdn.net")
caption = "w1cdn.net") +
theme(legend.position="bottom")
ggsave("plots/class-over-time.png", width = 6, height = 4)
##### By license class, stacked #####
ggplot(data = d_total_long %>% filter(lclass != "Total"),
@ -98,6 +106,9 @@ ggplot(data = d_total_long %>% filter(lclass != "Total"),
labs(title = "US Amateur Licenses by Class",
subtitle = "ARRL, AH0A",
fill = "Class",
caption = "w1cdn.net")
caption = "w1cdn.net") +
theme(legend.position="bottom")
ggsave("plots/class-over-time-stacked.png", width = 6, height = 4)

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

BIN
plots/class-over-time.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

BIN
plots/total-over-time-y.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

BIN
plots/total-over-time.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB