-
Notifications
You must be signed in to change notification settings - Fork 0
/
data_vis_for_GPR_figs.py
185 lines (152 loc) · 6.84 KB
/
data_vis_for_GPR_figs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
# This file is used for creating figures in the GPR results section.
df = pd.read_csv(r"D:\\Etienne\\fall2022\\agu_data\\results\\AGU_dataset.csv", encoding='unicode_escape')
### Histograms of GPR variables
# Tidal Amplitude
sns.set_theme(style='white', font_scale=1.4)
f = plt.figure(figsize=(8, 6))
ax = f.add_subplot(1, 1, 1)
sns.histplot(ax=ax, stat="count", multiple="stack", bins=30,
x=df['Tidal Amplitude (cm)'], kde=False,
hue=df["Community"], palette=['#ADD8E6', '#032180', '#5DC069', '#006E0D'],
element="bars", legend=True)
# ax.set_title("Distribution of Tidal Amplitude", fontsize=24)
ax.set_xlabel("Tidal Amplitude (cm)", fontsize=21)
ax.set_ylabel("Count", fontsize=21)
ax.tick_params(axis='both', which='major', labelsize=18)
f.legend(fontsize=21)
f.subplots_adjust(bottom=0.2)
plt.show()
f.savefig("D:\\Etienne\\PAPER_2023\\results_GPR\\hist_tidal.eps",
dpi=300, format="eps")
# NDVI
sns.set_theme(style='white', font_scale=1.4)
f = plt.figure(figsize=(8, 6))
ax = f.add_subplot(1, 1, 1)
sns.histplot(ax=ax, stat="count", multiple="stack", bins=30,
x=df['NDVI'], kde=False,
hue=df["Community"], palette=['#ADD8E6', '#032180', '#5DC069', '#006E0D'],
element="bars", legend=True)
# ax.set_title("Distribution of NDVI", fontsize=24)
ax.set_xlabel("NDVI", fontsize=21)
ax.set_ylabel("Count", fontsize=21)
ax.tick_params(axis='both', which='major', labelsize=18)
f.legend(fontsize=21)
f.subplots_adjust(bottom=0.2)
plt.show()
f.savefig("D:\\Etienne\\PAPER_2023\\results_GPR\\hist_ndvi.eps",
dpi=300, format="eps")
# Soil Porewater Salinity
sns.set_theme(style='white', font_scale=1.4)
f = plt.figure(figsize=(8, 6))
ax = f.add_subplot(1, 1, 1)
sns.histplot(ax=ax, stat="count", multiple="stack", bins=30,
x=df['Soil Porewater Salinity (ppt)'], kde=False,
hue=df["Community"], palette=['#ADD8E6', '#032180', '#5DC069', '#006E0D'],
element="bars", legend=True)
# ax.set_title("Distribution of Soil Porewater Salinity", fontsize=24)
ax.set_xlabel('Soil Porewater Salinity (ppt)', fontsize=21)
ax.set_ylabel("Count", fontsize=21)
ax.tick_params(axis='both', which='major', labelsize=18)
f.legend(fontsize=21)
f.subplots_adjust(bottom=0.2)
plt.show()
f.savefig("D:\\Etienne\\PAPER_2023\\results_GPR\\hist_salinity.eps",
dpi=300, format="eps")
# 90th percenitle flood depth
sns.set_theme(style='white', font_scale=1.4)
f = plt.figure(figsize=(8, 6))
ax = f.add_subplot(1, 1, 1)
sns.histplot(ax=ax, stat="count", multiple="stack", bins=30,
x=df['90th Percentile Flood Depth (cm)'], kde=False,
hue=df["Community"], palette=['#ADD8E6', '#032180', '#5DC069', '#006E0D'],
element="bars", legend=True)
# ax.set_title("Distribution of 90th Percentile Flood Depth", fontsize=24)
ax.set_xlabel('90th Percentile Flood Depth (cm)', fontsize=21)
ax.set_ylabel("Count", fontsize=21)
ax.tick_params(axis='both', which='major', labelsize=18)
f.legend(fontsize=21)
f.subplots_adjust(bottom=0.2)
plt.show()
f.savefig("D:\\Etienne\\PAPER_2023\\results_GPR\\hist_90flood.eps",
dpi=300, format="eps")
# TSS
sns.set_theme(style='white', font_scale=1.4)
f = plt.figure(figsize=(8, 6))
ax = f.add_subplot(1, 1, 1)
sns.histplot(ax=ax, stat="count", multiple="stack", bins=30,
x=df['TSS (mg/L)'], kde=False,
hue=df["Community"], palette=['#ADD8E6', '#032180', '#5DC069', '#006E0D'],
element="bars", legend=True)
# ax.set_title("Distribution of Total Suspended Solids", fontsize=24)
ax.set_xlabel('TSS (mg/L)', fontsize=21)
ax.set_ylabel("Count", fontsize=21)
ax.tick_params(axis='both', which='major', labelsize=18)
f.legend(fontsize=21)
f.subplots_adjust(bottom=0.2)
plt.show()
f.savefig("D:\\Etienne\\PAPER_2023\\results_GPR\\hist_TSS.eps",
dpi=300, format="eps")
########## Complimenting scatter plots
# Tidal plot
fig, ax = plt.subplots(figsize=(8, 6.5))
sns.scatterplot(data=df, x='Tidal Amplitude (cm)', y='Accretion Rate (mm/yr)',
hue='90th Percentile Flood Depth (cm)',
size='90th Percentile Flood Depth (cm)')
ax.set_xlabel('Tidal Amplitude (cm)', fontsize=21)
ax.set_ylabel('Accretion Rate (mm/yr)', fontsize=21)
ax.tick_params(axis='both', which='major', labelsize=18)
plt.legend(fontsize=14, title='90th Percentile Flood Depth (cm)', title_fontsize=18)
plt.show()
fig.savefig("D:\\Etienne\\PAPER_2023\\results_GPR\\scatter_tidal_flood_accretion.eps",
dpi=300, format="eps")
# NDVI plot
fig, ax = plt.subplots(figsize=(8, 6.5))
sns.scatterplot(data=df, x='NDVI', y='Accretion Rate (mm/yr)',
hue='Soil Porewater Salinity (ppt)',
size='Soil Porewater Salinity (ppt)')
ax.set_xlabel('NDVI', fontsize=21)
ax.set_ylabel('Accretion Rate (mm/yr)', fontsize=21)
ax.tick_params(axis='both', which='major', labelsize=18)
plt.legend(fontsize=14, title='Soil Porewater Salinity (ppt)', title_fontsize=18)
plt.show()
fig.savefig("D:\\Etienne\\PAPER_2023\\results_GPR\\scatter_ndvi_salinity_accretion.eps",
dpi=300, format="eps")
# Salinity plot
fig, ax = plt.subplots(figsize=(8, 6.5))
sns.scatterplot(data=df, x='Soil Porewater Salinity (ppt)', y='Accretion Rate (mm/yr)',
hue='NDVI',
size='NDVI')
ax.set_xlabel('Soil Porewater Salinity (ppt)', fontsize=21)
ax.set_ylabel('Accretion Rate (mm/yr)', fontsize=21)
ax.tick_params(axis='both', which='major', labelsize=18)
plt.legend(fontsize=14, title='NDVI', title_fontsize=18)
plt.show()
fig.savefig("D:\\Etienne\\PAPER_2023\\results_GPR\\scatter_salinity_ndvi_accretion.eps",
dpi=300, format="eps")
# 90th percentile flood plot
fig, ax = plt.subplots(figsize=(8, 6.5))
sns.scatterplot(data=df, x='90th Percentile Flood Depth (cm)', y='Accretion Rate (mm/yr)',
hue='Tidal Amplitude (cm)',
size='Tidal Amplitude (cm)')
ax.set_xlabel('90th Percentile Flood Depth (cm)', fontsize=21)
ax.set_ylabel('Accretion Rate (mm/yr)', fontsize=21)
ax.tick_params(axis='both', which='major', labelsize=18)
plt.legend(fontsize=14, title='Tidal Amplitude (cm)', title_fontsize=18)
plt.show()
fig.savefig("D:\\Etienne\\PAPER_2023\\results_GPR\\scatter_flood_tide_accretion.eps",
dpi=300, format="eps")
# TSS plot
fig, ax = plt.subplots(figsize=(8, 6.5))
sns.scatterplot(data=df, x='TSS (mg/L)', y='Accretion Rate (mm/yr)',
hue='Bulk Density (g/cm3)',
size='Bulk Density (g/cm3)')
ax.set_xlabel('TSS (mg/L)', fontsize=21)
ax.set_ylabel('Accretion Rate (mm/yr)', fontsize=21)
ax.tick_params(axis='both', which='major', labelsize=18)
plt.legend(fontsize=14, title='Bulk Density (g/cm3)', title_fontsize=18)
plt.show()
fig.savefig("D:\\Etienne\\PAPER_2023\\results_GPR\\scatter_tss_density_accretion.eps",
dpi=300, format="eps")