From 59ed270faa0738d57efb1cfcff4f546f61627859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 19 May 2021 22:57:52 +0300 Subject: [PATCH] some legends --- Makefile | 33 +++++++++++++++++++++------------ layer2img.py | 1 + 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index b847518..49a6428 100644 --- a/Makefile +++ b/Makefile @@ -102,7 +102,7 @@ mj-msc.pdf: mj-msc.tex version.inc.tex vars.inc.tex bib.bib \ define FIG_template $(1).pdf: layer2img.py Makefile $(2) python3 ./layer2img.py --outfile=$(1).pdf \ - $$(if $$($(1)_LEGEND),--legend=$$($(1)_LEGEND)) \ + $$(if $$($(1)_LEGEND),--legend="$$($(1)_LEGEND)") \ $$(if $$($(1)_WIDTHDIV),--widthdiv=$$($(1)_WIDTHDIV)) \ $$(if $$($(1)_QUADRANT),--quadrant=$$($(1)_QUADRANT)) \ $$(foreach i,1 2 3, \ @@ -269,17 +269,6 @@ salvis-wm-dp-chaikin-50k_1COLOR = green salvis-wm-dp-chaikin-50k_2COLOR = orange salvis-wm-dp-chaikin-50k_3LINESTYLE = dotted -salvis-wm-vw-50k_1SELECT = wm_visuals where name='salvis-vw-64' -salvis-wm-vw-50k_2SELECT = wm_visuals where name='salvis-wm-75' -salvis-wm-vw-50k_3SELECT = wm_visuals where name='salvis' -salvis-wm-vw-50k_1COLOR = green -salvis-wm-vw-50k_1LABEL = Visvalingam--Whyatt -salvis-wm-vw-50k_2COLOR = orange -salvis-wm-vw-50k_2LABEL = Wang--Müller -salvis-wm-vw-50k_3LINESTYLE = dotted -salvis-wm-vw-50k_3LABEL = GRPK -salvis-wm-vw-50k_LEGEND = "lower left" - salvis-wm-vw-chaikin-50k_1SELECT = wm_visuals where name='salvis-vw-64-chaikin' salvis-wm-vw-chaikin-50k_2SELECT = wm_visuals where name='salvis-wm-75' salvis-wm-vw-chaikin-50k_3SELECT = wm_visuals where name='salvis' @@ -287,6 +276,26 @@ salvis-wm-vw-chaikin-50k_1COLOR = green salvis-wm-vw-chaikin-50k_2COLOR = orange salvis-wm-vw-chaikin-50k_3LINESTYLE = dotted +label_wm = Wang--Müller +label_vw = Visvalingam--Whyatt +label_dp = Douglas \& Peucker +label_vw-chaikin = $(label_vw) and Chaikin +label_dp-chaikin = $(label_dp) and Chaikin + +define wm_vwdp50k +RIVERS += salvis-wm-$(1)-50k +salvis-wm-$(1)-50k_1SELECT = wm_visuals where name='salvis-$(1)-64' +salvis-wm-$(1)-50k_3SELECT = wm_visuals where name='salvis' +salvis-wm-$(1)-50k_1COLOR = green +salvis-wm-$(1)-50k_1LABEL = $(label_$(1)) +salvis-wm-$(1)-50k_2COLOR = orange +salvis-wm-$(1)-50k_2LABEL = $(label_wm) +salvis-wm-$(1)-50k_3LINESTYLE = dotted +salvis-wm-$(1)-50k_3LABEL = GRPK 1:\\numprint{10000} +salvis-wm-$(1)-50k_LEGEND = lower left +endef +$(foreach x,vw dp vw-chaikin dp-chaikin,$(eval $(call wm_vwdp50k,$(x)))) + .faux_db_pre: db init.sql bash db start diff --git a/layer2img.py b/layer2img.py index 185e139..a3a90cb 100644 --- a/layer2img.py +++ b/layer2img.py @@ -111,6 +111,7 @@ def main(): c3 = plot_args(g3, args.g3_color, args.g3_linestyle, args.g3_label) rc('text', usetex=True) + rc('text.latex', preamble='\\usepackage{numprint}\n') fig, ax = plt.subplots(constrained_layout=True) fig.set_figwidth(inch(width))