forked from PyPSA/atlite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchart.py
executable file
·82 lines (68 loc) · 1.88 KB
/
chart.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
# SPDX-FileCopyrightText: Contributors to atlite <https://github.com/pypsa/atlite>
#
# SPDX-License-Identifier: MIT
"""
Spyder Editor.
This is a temporary script file.
"""
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(12, 5))
ax.axis("off")
linebreak = "\n "
climatedata = [
"Temperature",
"Downward short-wave radiation",
"Upward short-wave radiation",
"Wind",
"Runoff",
"Surface roughness",
"Height maps",
"Soil temperature",
]
processeddata = [
f"Wind power generation {linebreak}for a given turbine type",
f"Solar PV power generation {linebreak}for a given panel type",
"Solar thermal collector heat output",
"Hydroelectric inflow (simplified)",
f"Heating demand {linebreak}" "(based on the degree-day approximation)",
]
climatestr = "\n" + "\n\n".join([" ◦ " + s for s in climatedata]) + "\n"
processedstr = "\n" + "\n\n\n".join([" ◦ " + s for s in processeddata]) + "\n"
# defaults for boxes and arrows
kwargs = dict(verticalalignment="center", fontsize=14, color="#545454")
arrowkwargs = dict(
head_width=0.2,
width=0.13,
head_length=0.05,
edgecolor="white",
length_includes_head=True,
color="lightgray",
alpha=1,
)
y = 0.5
# First arrow
ax.text(
0.01, y, " Retrieve Data", fontsize=14, color="gray", verticalalignment="center"
)
ax.arrow(0.01, y, 0.14, 0.0, **arrowkwargs)
# First box
ax.text(
0.17,
y,
climatestr,
**kwargs,
bbox=dict(facecolor="indianred", alpha=0.5, edgecolor="None", boxstyle="round"),
)
# Second arrow
ax.text(0.5, y, " Process Data", fontsize=14, color="gray", verticalalignment="center")
ax.arrow(0.5, y, 0.14, 0, **arrowkwargs)
# Second Box
ax.text(
0.66,
y,
processedstr,
**kwargs,
bbox=dict(facecolor="olivedrab", alpha=0.5, edgecolor="None", boxstyle="round"),
)
fig.tight_layout(pad=0)
fig.savefig("workflow.png", dpi=150)