-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprint_CELE.py
More file actions
50 lines (48 loc) · 1.27 KB
/
print_CELE.py
File metadata and controls
50 lines (48 loc) · 1.27 KB
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
import pandas as pd
import seaborn as sb
import matplotlib.pyplot as plt
# plt.rcParams.update({"font.size": 32})
sb.set_context("poster", font_scale=1.5)
# europe pop taken from https://www.worldometers.info/world-population/europe-population/
# usa from Data/SmallData/ElectricityByNation/PopByCountry.csv
# year=2018
x = pd.read_csv("CELE_region_values.csv")
# x = x[x["region"] != "usa"]
x["popRatio"] = (x["populationCELE"] / x["population"]) * 100
x["oneInXyears"] = 1 / x["rate"]
print(x)
_, axs = plt.subplots(1, 2, tight_layout=True, figsize=(22, 9))
for ax in axs:
ax.set(xscale="log", yscale="linear")
sb.lineplot(
x,
x="oneInXyears",
y="popRatio",
hue="region",
style="region",
markers=True,
dashes=False,
markersize=28,
linestyle="--",
legend="full",
ax=axs[0],
)
axs[0].set_xlabel("Strom recurrence [years]")
axs[0].set_ylabel("Population in CELE [%]")
sb.lineplot(
x,
x="oneInXyears",
y="populationCELE",
hue="region",
style="region",
markers=True,
dashes=False,
markersize=28,
linestyle="--",
legend=False,
ax=axs[1],
)
axs[1].set_xlabel("Strom recurrence [years]")
axs[1].set_ylabel("Population in CELE [people]")
plt.savefig("CELE_values.eps", bbox_inches="tight", dpi=72)
# plt.show()