/** @license 2023 Neil Edelman, distributed under the terms of the [MIT License](https://opensource.org/licenses/MIT). Date _vs_ hours flown. */ #include "journal.h" #include "scan_flight.h" #include #include #include #include int main(void) { int success = EXIT_SUCCESS; struct journal j; struct journal_iterator it; union date32 k; union load *v; size_t i; j = journal(); if(!journal_is_valid(&j)) goto catch; fprintf(stderr, "Journal: %s.\n", journal_to_string(&j)); printf("set term postscript eps enhanced\n" "set output \"flighthours.eps\"\n" "$Data <text, &kj)) goto catch; printf("EOD\n" "set monochrome\n" "set xdata time\n" "set timefmt \"%%Y-%%m-%%d\"\n" "set xtics format \"%%Y-%%m-%%d\" rotate by -30\n" "set ylabel \"words in KJV\"\n" "set format y \"%%g%%%%\"\n" "set key top left\n" "set grid\n" "unset border\n" "#set style fill solid 0.1 #pattern 5 (better, but restarts)\n" "plot $Data using 1:($3)*100/%zu with fillsteps lw 2 title \"set\", \\\n" "$Data using 1:($4)*100/%zu with steps lw 1 title \"cumulative\"\n", kj.words.total, kj.words.total); goto finally; catch: success = EXIT_FAILURE; perror("journal"); finally: journal_(&j); return success; }