fix figure size params

This commit is contained in:
Motiejus Jakštys 2020-05-26 17:36:13 +03:00
parent 6d3fcd2ff0
commit 56090d23e3
3 changed files with 18 additions and 9 deletions

View File

@ -7,7 +7,8 @@ GEN = $(addsuffix .pdf, \
$(addprefix zeimena-douglas-,$(ZEIMENA_TOLERANCES)) \
$(addprefix zeimena-visvalingam-,$(ZEIMENA_TOLERANCES)))
mj-referatas.pdf: mj-referatas.tex version.tex bib.bib zeimena.pdf sinewave.pdf $(GEN)
mj-referatas.pdf: mj-referatas.tex version.tex bib.bib zeimena.pdf \
sinewave.pdf crossing.pdf $(GEN)
latexmk -g -pdf $<
define algo2img
@ -21,16 +22,17 @@ crossing-$(1)-$(2)-%.pdf: layer2img.py db/.faux_$(1)-$(2)-%
endef
define gpkg2pdf
$(1).pdf: $(1).gpkg
./layer2img.py $(2) --infile=$(1).gpkg --outfile $(1).pdf
$(2): $(1)
./layer2img.py $(3) --infile=$(1) --outfile $(2)
endef
$(eval $(call algo2img,sinewave,douglas,52x12))
$(eval $(call algo2img,sinewave,visvalingam,52x12))
$(eval $(call algo2img,zeimena,douglas,52x74))
$(eval $(call algo2img,zeimena,visvalingam,52x74))
$(eval $(call gpkg2pdf,sinewave,--size=52x15))
$(eval $(call gpkg2pdf,zeimena,--size=148x210 --rect $(CROSSING)))
$(eval $(call gpkg2pdf,sinewave.gpkg,sinewave.pdf,--size=52x15))
$(eval $(call gpkg2pdf,zeimena.gpkg,zeimena.pdf,--size=148x210 --rect $(CROSSING)))
$(eval $(call gpkg2pdf,zeimena.gpkg,crossing.pdf,--size=105x74 --clip $(CROSSING)))
sinewave.gpkg: sinewave.py
./sinewave.py

View File

@ -48,16 +48,15 @@ def main():
else:
f = geopandas.read_file(args.infile)
fig, ax = plt.subplots()
f.plot(ax=ax, figsize=args.size)
fig.set_size_inches(args.size)
f.plot(ax=ax)
if c := args.clip:
ax.set_xlim(left=c[0], right=c[2])
ax.set_ylim(bottom=c[1], top=c[3])
if r := args.rect:
w, h = r[2] - r[0], r[3] - r[1]
rect = patches.Rectangle(
(r[0], r[1]),
w, h,
linewidth=1,edgecolor='r',facecolor='none')
(r[0], r[1]), w, h, linewidth=1,edgecolor='r',facecolor='none')
ax.add_patch(rect)
ax.axis('off')

View File

@ -163,6 +163,14 @@ help explain some of the deficiencies in the reviewed algorithms.
\label{fig:zeimena}
\end{figure}
\begin{figure}[h]
\centering
\includegraphics[width=74mm]{crossing}
\caption{River crossing zoomed in}
\label{fig:crossing}
\end{figure}
To visually evaluate the Žeimena sample, examples for {\DP} and {\VW}
were created using the following parameters: