From f3bc22b5ba659cc01159f3ec20ce6981a5970bcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 19 May 2021 22:57:47 +0300 Subject: [PATCH] add fig8 --- Makefile | 2 +- layer2img.py | 7 +++---- tests.sql | 1 + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 1c3043b..d6959d0 100644 --- a/Makefile +++ b/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/layer2img.py b/layer2img.py index b427565..9b23184 100644 --- a/layer2img.py +++ b/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/tests.sql b/tests.sql index c4759ef..9a8a5b0 100644 --- a/tests.sql +++ b/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))'));