-
Notifications
You must be signed in to change notification settings - Fork 3
/
plot.qmd
189 lines (163 loc) · 6.16 KB
/
plot.qmd
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
185
186
187
188
189
---
title: "Route network simplification for transport planning"
# methods and applications"
# Alternatives:
# title: "Network simplification: application to the visualisation of transport networks"
# title: "methods and applications to support the visualisation, modelling and redesign of transport systems"
bibliography: references.bib
author:
- name: Robin Lovelace
affiliation: Leeds Institute for Transport Studies, University of Leeds, UK
orcid: 0000-0001-5679-6536
- name: Zhao Wang
affiliation: Leeds Institute for Transport Studies, University of Leeds, UK
orcid: 0000-0002-4054-0533
- name: Will Deakin
affiliation: Network Rail, UK
orcid: 0009-0008-5656-4469
- name: Josiah Parry
affiliation: Environmental Systems Research Institute, Redlands, CA, USA
orcid: 0000-0001-9910-865X
format:
# pdf: default
html: default
number-sections: true
execute:
echo: false
message: false
warning: false
editor:
markdown:
wrap: sentence
# # Uncomment to run with Jupyter:
# jupyter: python3
---
```{python}
from pathlib import Path
import geopandas as gp
import matplotlib.pyplot as plt
PLOT_DATA = ("base_armley,base_edinburgh,base_doncaster,armley_sk,edinburgh_sk,doncaster_sk,"
"armley_line,edinburgh_line,doncaster_line,armley_edge_sk,edinburgh_edge_sk,"
"doncaster_edge_sk,armley_edge,edinburgh_edge,doncaster_edge").split(",")
for variable in PLOT_DATA:
filepath = Path(f"data/rnet_{variable}.geojson")
if variable in globals():
continue
if filepath.exists():
data = gp.read_file(filepath)
globals()[variable] = data
```
::: {#fig-results layout-ncol="1" layout-nrow="1"}
```{python}
# import matplotlib.pyplot as plt
# Create a figure with 5 subplots in one row
#plt.rcParams["figure.dpi"] = 300
#fig, ax = plt.subplots(3, 1, figsize=(8.5, 5.31), dpi=300.0) # Adjust the size as needed
fig, ax = plt.subplots(3, 1, dpi=300.0) # Adjust the size as needed
#fig, ax = plt.subplots(3, 1, figsize=(6, 4), dpi=300.0) # Adjust the size as needed
# Plot 1: Input
ax[0] = base_edinburgh.plot(ax=ax[0], color="blue", linewidth=1.0)
ax[0].grid(True, color="grey", linestyle="--", linewidth=0.5)
ax[0].xaxis.set_ticklabels([])
ax[0].yaxis.set_ticklabels([])
ax[0].set_title("Input", y=1.0, pad=-6)
ax[0].title.set_fontsize(4)
# Plot 2: Skeletonized
ax[1] = edinburgh_sk.plot(ax=ax[1], color="green", linewidth=1.0)
ax[1].grid(True, color="grey", linestyle="--", linewidth=0.5)
ax[1].xaxis.set_ticklabels([])
ax[1].yaxis.set_ticklabels([])
ax[1].set_title("Skeletonized", y=1.0, pad=-6)
ax[1].title.set_fontsize(4)
# Plot 3: Voronoi
ax[2] = edinburgh_line.plot(ax=ax[2], color="orange", linewidth=1.0)
ax[2].grid(True, color="grey", linestyle="--", linewidth=0.5)
ax[2].xaxis.set_ticklabels([])
ax[2].yaxis.set_ticklabels([])
ax[2].set_title("Voronoi", y=1.0, pad=-6)
ax[2].title.set_fontsize(4)
plt.tight_layout(w_pad=16.0, h_pad=0.0)
plt.show()
```
Matrix of Route Network Simplification Stages in Edinburgh.
:::
::: {#fig-results-primal layout-ncol="1" layout-nrow="1"}
```{python}
fig, ax = plt.subplots(2, 1, figsize=(5.67, 5.31), dpi=300.0) # Adjust the size as needed
# Plot 1: Input
# ax[0] = base_edinburgh.plot(ax=ax[0], color="blue")
# ax[0].grid(True, color="grey", linestyle="--", linewidth=0.5)
# ax[0].xaxis.set_ticklabels([])
# ax[0].yaxis.set_ticklabels([])
#ax[0].set_title("Input")
# Plot 4: Primal Skeletonized
ax[0] = edinburgh_edge_sk.plot(ax=ax[0], color="orchid")
ax[0].grid(True, color="grey", linestyle="--", linewidth=0.67)
ax[0].xaxis.set_ticklabels([])
ax[0].yaxis.set_ticklabels([])
ax[0].set_title("Primal Skeletonized", y=1.0, pad=-9)
ax[0].title.set_fontsize(8)
# Plot 5: Primal Voronoi
ax[1] = edinburgh_edge.plot(ax=ax[1], color="tomato")
ax[1].grid(True, color="grey", linestyle="--", linewidth=0.67)
ax[1].xaxis.set_ticklabels([])
ax[1].yaxis.set_ticklabels([])
ax[1].set_title("Primal Voronoi", y=1.0, pad=-9)
ax[1].title.set_fontsize(8)
#ax[2].xaxis.set_ticklabels([])
#ax[2].yaxis.set_ticklabels([])
plt.tight_layout(w_pad=1.0, h_pad=0.0)
#plt.tight_layout()
plt.show()
```
Matrix of Route Network Primal Simplification Stages in Edinburgh.
:::
::: {#fig-results layout-ncol="1" layout-nrow="1"}
```{python}
# import matplotlib.pyplot as plt
# Create a figure with 5 subplots in one row
#plt.rcParams["figure.dpi"] = 300
#fig, ax = plt.subplots(3, 1, figsize=(8.5, 5.31), dpi=300.0) # Adjust the size as needed
fig, ax = plt.subplots(2, 2, dpi=300.0) # Adjust the size as needed
#fig, ax = plt.subplots(3, 1, figsize=(6, 4), dpi=300.0) # Adjust the size as needed
# # Plot 1: Input
# ax[0] = base_edinburgh.plot(ax=ax[0], color="blue", linewidth=1.0)
# ax[0].grid(True, color="grey", linestyle="--", linewidth=0.5)
# ax[0].xaxis.set_ticklabels([])
# ax[0].yaxis.set_ticklabels([])
# ax[0].set_title("Input", y=1.0, pad=-6)
# ax[0].title.set_fontsize(4)
# Plot 2: Skeletonized
ax[0, 0] = edinburgh_sk.plot(ax=ax[0, 0], color="green", linewidth=1.0)
ax[0, 0].grid(True, color="grey", linestyle="--", linewidth=0.5)
ax[0, 0].xaxis.set_ticklabels([])
ax[0, 0].yaxis.set_ticklabels([])
ax[0, 0].set_title("Skeletonized", y=1.0, pad=-9)
ax[0, 0].title.set_fontsize(8)
# Plot 3: Voronoi
ax[0, 1] = edinburgh_line.plot(ax=ax[0, 1], color="orange", linewidth=1.0)
ax[0, 1].grid(True, color="grey", linestyle="--", linewidth=0.5)
ax[0, 1].xaxis.set_ticklabels([])
ax[0, 1].yaxis.set_ticklabels([])
ax[0, 1].set_title("Voronoi", y=1.0, pad=-9)
ax[0, 1].title.set_fontsize(8)
# Plot 4: Primal Skeletonized
ax[1, 0] = edinburgh_edge_sk.plot(ax=ax[1, 0], color="orchid")
ax[1, 0].grid(True, color="grey", linestyle="--", linewidth=0.67)
ax[1, 0].xaxis.set_ticklabels([])
ax[1, 0].yaxis.set_ticklabels([])
ax[1, 0].set_title("Primal Skeletonized", y=1.0, pad=-9)
ax[1, 0].title.set_fontsize(8)
# Plot 5: Primal Voronoi
ax[1, 1] = edinburgh_edge.plot(ax=ax[1, 1], color="tomato")
ax[1, 1].grid(True, color="grey", linestyle="--", linewidth=0.67)
ax[1, 1].xaxis.set_ticklabels([])
ax[1, 1].yaxis.set_ticklabels([])
ax[1, 1].set_title("Primal Voronoi", y=1.0, pad=-9)
ax[1, 1].title.set_fontsize(8)
plt.tight_layout(w_pad=1.0, h_pad=0.0)
#plt.tight_layout()
plt.show()
```
Matrix of Route Network Simplification Stages in Edinburgh.
:::