commit 6134a333c1c5dc84aec2de7c4d22e50d59a5c0df (tree)
parent 7cb1c7058a95a11d5be61f229646eb6343bfa213
Author: Motiejus Jakštys <motiejus@uber.com>
Date: Sun, 11 Apr 2021 09:30:30 +0300
add fig8
Diffstat:
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/IV/Makefile b/IV/Makefile
@@ -49,7 +49,7 @@ test-figures.pdf: layer2img.py .faux_test
fig-definition-of-a-bend.pdf: layer2img.py Makefile .faux_test
python ./layer2img.py \
--group1-table=wm_debug \
- --group1-cmap=True \
+ --group1-cmap=1 \
--group1-where="name='fig6' AND stage='bbends-polygon' AND gen=1" \
--group2-table=wm_debug \
--group2-where="name='fig6' AND stage='bbends' AND gen=1" \
diff --git a/IV/layer2img.py b/IV/layer2img.py
@@ -59,6 +59,9 @@ def main():
group1 = read_layer(args.group1_table, args.group1_where)
group2 = read_layer(args.group2_table, args.group2_where)
group3 = read_layer(args.group3_table, args.group3_where)
+ c1 = {'cmap': 'coolwarm'} if args.group1_cmap else {'color': ORANGE}
+ c2 = {'cmap': 'coolwarm'} if args.group2_cmap else {'color': PURPLE}
+ c3 = {'cmap': 'coolwarm'} if args.group3_cmap else {'color': GREEN}
rc('text', usetex=True)
fig, ax = plt.subplots()
@@ -68,10 +71,6 @@ def main():
ax.set_xlim(left=c[0], right=c[2])
ax.set_ylim(bottom=c[1], top=c[3])
- c1 = {'cmap': 'coolwarm'} if args.group1_cmap else {'color': ORANGE}
- c2 = {'cmap': 'coolwarm'} if args.group2_cmap else {'color': PURPLE}
- c3 = {'cmap': 'coolwarm'} if args.group3_cmap else {'color': GREEN}
-
group1 is not None and group1.plot(ax=ax, **c1)
group2 is not None and group2.plot(ax=ax, **c2)
group3 is not None and group3.plot(ax=ax, **c3)
diff --git a/IV/tests.sql b/IV/tests.sql
@@ -41,6 +41,7 @@ insert into wm_figures (name, way) values ('fig6-combi',
ST_Translate((select way from wm_figures where name='fig6'), 80, 90)
)
);
+insert into wm_figures (name, way) values('fig8', ST_GeomFromText('LINESTRING(173 12,174 10,180 8,186 8,186 13,191 11,189 6,201 5,203 11,216 16,216 6,222 7,229 3,236 2,239 6,243 8,248 6)'));
insert into wm_figures (name, way) values ('inflection-1',ST_GeomFromText('LINESTRING(110 24,114 20,133 20,145 15,145 0,136 5,123 7,114 7,111 2)'));
insert into wm_figures (name, way) values ('multi-island',ST_GeomFromText('MULTILINESTRING((-15 10,-10 10,-5 11,0 11,5 11,10 10,11 9,13 10,15 9),(-5 11,-2 15,0 16,2 15,5 11))'));