diff options
author | Arun Isaac | 2020-12-31 23:43:42 +0530 |
---|---|---|
committer | Arun Isaac | 2022-10-01 01:11:16 +0530 |
commit | 6014a6770fcd966fa58f6b9e96c306f5a1f477ee (patch) | |
tree | ae3d119d38fd9ff6361a55085ce38736193c48b0 /biometry.asy | |
parent | d4bcb32a3ef029e9897b6467ff1c4b8f1640c4c7 (diff) | |
download | ksh-reports-6014a6770fcd966fa58f6b9e96c306f5a1f477ee.tar.gz ksh-reports-6014a6770fcd966fa58f6b9e96c306f5a1f477ee.tar.lz ksh-reports-6014a6770fcd966fa58f6b9e96c306f5a1f477ee.zip |
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.
Diffstat (limited to 'biometry.asy')
-rw-r--r-- | biometry.asy | 38 |
1 files changed, 0 insertions, 38 deletions
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 |