Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MacroMIP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Blanz, Dr. Benjamin
MacroMIP
Commits
0db3460e
Commit
0db3460e
authored
Aug 27, 2024
by
Benjamin Blanz
Browse files
Options
Downloads
Patches
Plain Diff
Adjusted figure legends and size
parent
7652dd95
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
resultsFigures/Raw Results Analysis_BB.py
+13
-13
13 additions, 13 deletions
resultsFigures/Raw Results Analysis_BB.py
with
13 additions
and
13 deletions
resultsFigures/Raw Results Analysis_BB.py
+
13
−
13
View file @
0db3460e
...
...
@@ -143,7 +143,7 @@ sectors_nace_62 = ['A01', 'A02', 'A03', 'B', 'C10-C12', 'C13-C15', 'C16', 'C17',
sectors_nace_1
=
[
'
A
'
,
'
B
'
,
'
C
'
,
'
D
'
,
'
E
'
,
'
F
'
,
'
G
'
,
'
H
'
,
'
I
'
,
'
J
'
,
'
K
'
,
'
L
'
,
'
M
'
,
'
N
'
,
'
O
'
,
'
P
'
,
'
Q
'
,
'
R
'
,
'
S
'
]
key_sectors
=
[
'
A01
'
,
'
H50
'
,
'
H51
'
,
'
H52
'
,
'
H53
'
,
'
K64
'
,
'
K65
'
]
time_steps
=
[
f
"
Q
{
i
}
"
for
i
in
range
(
0
,
13
)]
time_steps
=
[
f
"
Q
uarter
{
i
}
"
for
i
in
range
(
0
,
13
)]
experiments
=
[
f
"
E
{
i
}
"
for
i
in
range
(
0
,
18
)]
...
...
@@ -156,15 +156,15 @@ sectors_nace_62_colors = cm.tab20(np.linspace(0, 1, len(sectors_nace_62)))
#%% load data
print
(
'
loading data
'
)
# `data` is a dictionary with variable names as keys and loaded matrices as values
base
=
loadmat
(
'
Baseline.mat
'
)
shock_eq
=
loadmat
(
'
Earthquake_Q1.mat
'
)
shock_f
=
loadmat
(
'
Flood_Q1.mat
'
)
shock_eq_f
=
loadmat
(
'
Earthquake_Q1_Flood_Q5.mat
'
)
shock_f_eq
=
loadmat
(
'
Flood_Q1_Earthquake_Q5.mat
'
)
base
=
loadmat
(
'
data/
Baseline.mat
'
)
shock_eq
=
loadmat
(
'
data/
Earthquake_Q1.mat
'
)
shock_f
=
loadmat
(
'
data/
Flood_Q1.mat
'
)
shock_eq_f
=
loadmat
(
'
data/
Earthquake_Q1_Flood_Q5.mat
'
)
shock_f_eq
=
loadmat
(
'
data/
Flood_Q1_Earthquake_Q5.mat
'
)
scenarios
=
[
shock_f
,
shock_eq
,
shock_f_eq
,
shock_eq_f
]
scenarios_names
=
[
"
flood
"
,
"
earthquake
"
,
"
co
mpound
flood earthquake
"
,
"
co
mpound
earthquake flood
"
]
scenarios_names
=
[
"
flood
"
,
"
earthquake
"
,
"
co
nsecutive
flood earthquake
"
,
"
co
secutive
earthquake flood
"
]
scenarios_colors
=
[
"
deepskyblue
"
,
"
indianred
"
,
"
deepskyblue
"
,
"
indianred
"
]
scenarios_linest
=
[
"
-
"
,
"
-
"
,
"
--
"
,
"
--
"
]
...
...
@@ -173,7 +173,7 @@ print('loading map')
sns
.
set
(
style
=
"
whitegrid
"
,
palette
=
"
pastel
"
,
color_codes
=
True
)
sns
.
mpl
.
rc
(
"
figure
"
,
figsize
=
(
10
,
6
))
world
=
gpd
.
read_file
(
"
ne_110m_admin_0_countries/ne_110m_admin_0_countries.shp
"
)
world
=
gpd
.
read_file
(
"
data/
ne_110m_admin_0_countries/ne_110m_admin_0_countries.shp
"
)
europe
=
world
#world[world['CONTINENT']=='Europe']
europe
.
insert
(
len
(
europe
.
columns
),
'
INSET_FIG_X
'
,
europe
[
'
LABEL_X
'
])
europe
.
insert
(
len
(
europe
.
columns
),
'
INSET_FIG_Y
'
,
europe
[
'
LABEL_Y
'
])
...
...
@@ -279,7 +279,7 @@ for s in range(len(scenarios)):
scenarios_dif_rel
[
s
][
thingsWeCareAbout
[
j
]]
=
(
scenarios
[
s
][
thingsWeCareAbout
[
j
]]
-
base
[
thingsWeCareAbout
[
j
]])
/
base
[
thingsWeCareAbout
[
j
]]
#%%
grid
plots
#%%
time series
plots
print
(
'
plotting time series
'
)
figdir
=
'
figures/timeseries
'
...
...
@@ -291,8 +291,8 @@ for plotType in plotTypes:
# Creating a figure and a grid of subplots
nrows
=
6
ncols
=
5
subfig_size
=
[
5
,
6
]
if
os
.
path
.
isfile
(
figdir
+
'
/timeseries_
'
+
thing
+
'
_as_
'
+
plotType
+
'
.png
'
):
subfig_size
=
[
2.
5
,
2
]
if
False
&
os
.
path
.
isfile
(
figdir
+
'
/timeseries_
'
+
thing
+
'
_as_
'
+
plotType
+
'
.png
'
):
print
(
'
skipping grid plots
'
+
plotType
+
'
file exists.
'
)
else
:
print
(
'
plotting grid plots
'
+
plotType
)
...
...
@@ -325,11 +325,11 @@ for plotType in plotTypes:
color
=
scenarios_colors
[
s
],
linestyle
=
scenarios_linest
[
s
])
ax
.
set_ylim
(
min_val
,
max_val
)
ax
.
set_title
(
f
'
{
code
}
'
)
ax
.
set_xlabel
(
'
Time S
te
p
'
)
ax
.
set_xlabel
(
'
Quar
te
r
'
)
ax
.
set_ylabel
(
thing
)
col
+=
1
handles
,
labels
=
ax
.
get_legend_handles_labels
()
fig
.
legend
(
handles
,
labels
,
loc
=
'
lower right
'
)
fig
.
legend
(
handles
,
labels
,
loc
=
'
lower right
'
,
prop
=
{
'
size
'
:
18
}
)
# Hide unused subplots
for
index
in
range
(
num_countries
,
nrows
*
ncols
):
# Adjust the range if the grid size is changed
if
(
col
==
ncols
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment