change slide4 image orientation
This commit is contained in:
parent
2c844c4c8a
commit
5d4f816bc9
5 changed files with 7 additions and 6 deletions
Binary file not shown.
|
|
@ -302,24 +302,25 @@ clusters_geo <- clusters |>
|
||||||
fig_county <- clusters_geo |>
|
fig_county <- clusters_geo |>
|
||||||
count(county, cluster_label) |>
|
count(county, cluster_label) |>
|
||||||
mutate(
|
mutate(
|
||||||
|
# south at bottom → north at top: keep county_order as factor levels
|
||||||
county = factor(county, levels = county_order),
|
county = factor(county, levels = county_order),
|
||||||
cluster_label = factor(cluster_label, levels = cluster_labels)
|
cluster_label = factor(cluster_label, levels = cluster_labels)
|
||||||
) |>
|
) |>
|
||||||
ggplot(aes(county, n, fill = cluster_label)) +
|
ggplot(aes(x = n, y = county, fill = cluster_label)) +
|
||||||
geom_col(position = "fill") +
|
geom_col(position = "fill") +
|
||||||
scale_fill_manual(values = cluster_palette |> set_names(cluster_labels),
|
scale_fill_manual(values = cluster_palette |> set_names(cluster_labels),
|
||||||
name = NULL) +
|
name = NULL) +
|
||||||
scale_y_continuous(labels = scales::percent_format(), expand = c(0, 0)) +
|
scale_x_continuous(labels = scales::percent_format(), expand = c(0, 0)) +
|
||||||
labs(x = NULL, y = "Share of municipalities") +
|
labs(y = NULL, x = "Share of municipalities") +
|
||||||
theme(
|
theme(
|
||||||
axis.text.x = element_text(angle = 45, hjust = 1, size = 11),
|
axis.text.y = element_text(size = 11),
|
||||||
legend.position = "bottom",
|
legend.position = "bottom",
|
||||||
legend.text = element_text(size = 10)
|
legend.text = element_text(size = 10)
|
||||||
) +
|
) +
|
||||||
guides(fill = guide_legend(nrow = 2))
|
guides(fill = guide_legend(nrow = 3))
|
||||||
|
|
||||||
ggsave("ppt/figures/slide4_county.png", fig_county,
|
ggsave("ppt/figures/slide4_county.png", fig_county,
|
||||||
width = 12, height = 6.5, dpi = 150)
|
width = 8, height = 9, dpi = 150)
|
||||||
message("Saved: ppt/figures/slide4_county.png")
|
message("Saved: ppt/figures/slide4_county.png")
|
||||||
|
|
||||||
message("\nAll figures written to ppt/figures/. Ready to paste into the slide deck.")
|
message("\nAll figures written to ppt/figures/. Ready to paste into the slide deck.")
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 176 KiB After Width: | Height: | Size: 176 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 197 KiB After Width: | Height: | Size: 197 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 48 KiB |
Loading…
Add table
Reference in a new issue