From 6014a6770fcd966fa58f6b9e96c306f5a1f477ee Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Thu, 31 Dec 2020 23:43:42 +0530 Subject: Use tikz to draw biometry. * ksh-report.el (draw-biometry, make-temp-script, combine-pdfs, crop-pdf): Delete functions. (biometry-subfloat, latex-macro): New functions. (insert-biometry): Use tikz to draw biometry. (make-report-header): Use subfig and tikz packages. Use calc tikz library. Define tickheight, parameterheight and parameterageheight macros. * biometry.asy: Delete file. --- biometry.asy | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 biometry.asy (limited to 'biometry.asy') diff --git a/biometry.asy b/biometry.asy deleted file mode 100644 index 294c212..0000000 --- a/biometry.asy +++ /dev/null @@ -1,38 +0,0 @@ -pair pair_ratio(pair a, pair b, real fraction) { - return a + (b - a)*fraction; -} -real real_ratio(real a, real b, real fraction) { - return a + (b - a)*fraction; -} -void draw_tic(pair a, pair b, real fraction, real tic_height, bool label) { - pair pt1 = pair_ratio(a, b, fraction); - pair pt2 = pt1 - (0, tic_height); - draw(pt1 -- pt2); - if (label) { - label(format("%f\%", fraction*100), pt2, S); - } -} -void draw_marker(pair a, pair b, real value, real marker_height) { - pair markpt = pair_ratio(a, b, value); - pair pt = (markpt.x, markpt.y + marker_height); - label("*", pt); -} -void draw_scale(pair a, pair b, real value, real tic_height) { - draw(pair_ratio(a, b, 0) -- pair_ratio(a, b, 1)); - draw_tic(a, b, 0.05, tic_height, true); - draw_tic(a, b, 0.5, tic_height, true); - draw_tic(a, b, 0.95, tic_height, true); - draw_tic(a, b, 0.25, 0.5*tic_height, false); - draw_tic(a, b, 0.75, 0.5*tic_height, false); - draw_marker(a, b, value, 0.5*tic_height); -} -void draw_biometry(string param, string param_age, real percentile) { - real width = 100; - real height = 75; - - label(param, (width/2, 2*height/3), N); - label(param_age, (width/2, 2*height/3), S); - pair scale1 = (0.1*width, 0.25*height); - pair scale2 = (0.9*width, 0.25*height); - draw_scale(scale1, scale2, percentile/100, 0.1*height); -} \ No newline at end of file -- cgit v1.2.3