Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
thornoe committed Jan 22, 2025
1 parent 7b76236 commit 10cb892
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions gis/output/all_VP_shore length_stats.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
& n & mean & std & min & 25\% & 50\% & 75\% & max \\
\midrule
Coastline & 108 & 64.05 & 57.70 & 0.39 & 18.28 & 47.00 & 88.63 & 288.35 \\
Shore length of lakes in VP3 & 90 & 37.14 & 62.58 & 0.61 & 4.18 & 11.07 & 49.02 & 436.75 \\
Shore length of streams in VP3 & 101 & 367.84 & 580.51 & 2.19 & 40.21 & 160.83 & 377.16 & 3664.68 \\
Shore length of all water bodies in VP3 & 108 & 439.00 & 632.11 & 5.74 & 67.82 & 212.27 & 530.82 & 4112.75 \\
Lake shores in RBMP3 & 90 & 37.14 & 62.58 & 0.61 & 4.18 & 11.07 & 49.02 & 436.75 \\
Stream shores in RBMP3 & 101 & 367.84 & 580.51 & 2.19 & 40.21 & 160.83 & 377.16 & 3664.68 \\
All shores in RBMP3 & 108 & 439.00 & 632.11 & 5.74 & 67.82 & 212.27 & 530.82 & 4112.75 \\
Proportion of arable land & 108 & 0.64 & 0.16 & 0.10 & 0.58 & 0.66 & 0.72 & 1.00 \\
\bottomrule
\end{tabular}
Binary file modified gis/output/all_demographics_N.pdf
Binary file not shown.
Binary file modified gis/output/all_demographics_age.pdf
Binary file not shown.
Binary file modified gis/output/all_demographics_y.pdf
Binary file not shown.
18 changes: 10 additions & 8 deletions gis/sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@
# Import Operation System (os)
import os

# Import Pandas and ticker.FuncFormatter
# Import pyplot, NumPy, Pandas, seaborn, and matplotlib.ticker.FuncFormatter
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib.ticker import FuncFormatter

########################################################################################
Expand Down Expand Up @@ -436,9 +439,9 @@ def y_f(x, pos):
)
SL.columns = [
"Coastline",
"Shore length of lakes in VP3",
"Shore length of streams in VP3",
"Shore length of all water bodies in VP3",
"Lake shores in RBMP3",
"Stream shores in RBMP3",
"All shores in RBMP3",
]
PAL = pd.read_excel(
"data\\" + data["shared"][2], index_col=0
Expand All @@ -461,7 +464,7 @@ def y_f(x, pos):
# Box plot for mean real income
plt.figure()
sns.boxplot(x="t", y="y", data=Dem, palette=["#CCBB44"])
plt.title("Distribution of mean real household income over catchment areas")
# plt.title("Distribution of mean real household income over catchment areas")
plt.xlabel("") # omit x-axis label
plt.ylabel("Mean real household income (100,000 DKK, 2018 prices)")
plt.xticks(rotation=90)
Expand All @@ -473,7 +476,7 @@ def y_f(x, pos):
Dem["N"] = Dem["N"] / 100000 # convert number of households to 100,000
plt.figure()
sns.boxplot(x="t", y="N", data=Dem, palette=["#AA3377"])
plt.title("Distribution of households over catchment areas")
# plt.title("Distribution of number of households over catchment areas")
plt.xlabel("") # omit x-axis label
plt.ylabel("Number of households (100,000)")
plt.xticks(rotation=90)
Expand All @@ -484,7 +487,7 @@ def y_f(x, pos):
# Box plot for mean age
plt.figure()
sns.boxplot(x="t", y="age", data=Dem, palette=["#EE6677"])
plt.title("Distribution of mean age over catchment areas")
# plt.title("Distribution of mean age over catchment areas")
plt.xlabel("") # omit x-axis label
plt.ylabel("Mean age")
plt.yticks([35, 40, 45, 50, 55]) # set specific tick positions on y-axis
Expand All @@ -495,4 +498,3 @@ def y_f(x, pos):
plt.close() # close plot to free up memory
n = Dem.groupby("t")["D age"].sum() # number of catchment areas w. mean age > 45 years
pd.DataFrame({"n": n, "s (%)": 100 * n / 108}) # number and share: mean age > 45 years
pd.DataFrame({"n": n, "s (%)": 100 * n / 108}) # number and share: mean age > 45 years

0 comments on commit 10cb892

Please sign in to comment.