updated graph
This commit is contained in:
parent
bfffbde238
commit
1ac0ef5283
@ -22,9 +22,12 @@ int main(void) {
|
|||||||
if(errno) goto catch;
|
if(errno) goto catch;
|
||||||
fprintf(stderr, "Journal: %s.\n"
|
fprintf(stderr, "Journal: %s.\n"
|
||||||
"Flights: %s.\n", journal_to_string(&j), flights_to_string(&f));
|
"Flights: %s.\n", journal_to_string(&j), flights_to_string(&f));
|
||||||
printf("set term postscript eps enhanced\n"
|
printf("set terminal cairolatex standalone pdf size 16cm,10.5cm"
|
||||||
"set output \"flighthours.eps\"\n"
|
" dashed transparent\n"
|
||||||
"$Data <<EOD\n"
|
"set output \"flight.tex\"\n");
|
||||||
|
/*printf("set term postscript eps enhanced\n"
|
||||||
|
"set output \"flighthours.eps\"\n");*/
|
||||||
|
printf("$Data <<EOD\n"
|
||||||
"# date\tsource\treg\tsic\tpic\ttotal\n");
|
"# date\tsource\treg\tsic\tpic\ttotal\n");
|
||||||
struct flights_iterator it = flights_iterator(&f);
|
struct flights_iterator it = flights_iterator(&f);
|
||||||
union line64 line;
|
union line64 line;
|
||||||
@ -60,17 +63,33 @@ int main(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("EOD\n"
|
printf("EOD\n"
|
||||||
"set monochrome\n"
|
"# theozh https://stackoverflow.com/a/75466214/2472827\n"
|
||||||
"set xdata time\n"
|
"# get a unique list from datablock\n"
|
||||||
"set timefmt \"%%Y-%%m-%%d\"\n"
|
"addToList(list,col) = list.( strstrt(list,'\"'.strcol(col).'\"') > 0 "
|
||||||
"set xtics format \"%%Y-%%m-%%d\" rotate by -30\n"
|
"? \\\n"
|
||||||
"set ylabel \"hours\"\n"
|
" '' : ' \"'.strcol(col).'\"')\n"
|
||||||
|
"Uniqs = ''\n"
|
||||||
|
"stats $Data u (Uniqs=addToList(Uniqs,3)) nooutput\n"
|
||||||
|
"Uniq(i) = word(Uniqs,i)\n"
|
||||||
|
"getIndex(s) = sum [_i=1:words(Uniqs)] s eq word(Uniqs,_i) ? _i : 0\n"
|
||||||
|
"myTimeFmt = \"%%Y-%%m-%%d\"\n"
|
||||||
|
"set format x myTimeFmt timedate\n"
|
||||||
|
"set xtics format myTimeFmt rotate by -30\n"
|
||||||
|
"set format y \"%%tH:%%tM\" timedate\n"
|
||||||
"set grid\n"
|
"set grid\n"
|
||||||
"unset key\n"
|
"set key out reverse Left noautotitle\n"
|
||||||
|
"set style fill solid 0.5\n"
|
||||||
"unset border\n"
|
"unset border\n"
|
||||||
"set xrange [*:'2001-09-11']\n"
|
"plot total=0 $Data u"
|
||||||
"#set style fill solid 0.1 #pattern 5 (better, but restarts)\n"
|
" (timecolumn(1,myTimeFmt)):(dy=($4+$5)*60,total=total+dy)"
|
||||||
"plot $Data using 1:($6/60) with fillsteps lw 2\n");
|
" w steps lc \"black\" dt 3, \\\n"
|
||||||
|
" total=0 '' u (timecolumn(1,myTimeFmt)):"
|
||||||
|
"(dy=($4+$5)*60,total=total+dy,total-dy/2.): \\\n"
|
||||||
|
" (43200):(dy/2.):(getIndex(strcol(3))) w boxxy lc var, \\\n"
|
||||||
|
" for [i=1:words(Uniqs)] keyentry w boxxy lc i ti Uniq(i)\n"
|
||||||
|
/*"set xrange [*:'2001-09-11']\n"*/
|
||||||
|
/*"#set style fill solid 0.1 #pattern 5 (better, but restarts)\n"
|
||||||
|
"plot $Data using 1:($6/60) with fillsteps lw 2\n"*/);
|
||||||
goto finally;
|
goto finally;
|
||||||
catch:
|
catch:
|
||||||
success = EXIT_FAILURE;
|
success = EXIT_FAILURE;
|
||||||
|
@ -42,6 +42,6 @@ finally:
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct text text(void) { struct text text; text.a = char_array(); return text; }
|
struct text text(void) { struct text text; text.a = char_array(); return text; }
|
||||||
void text_(struct text *const text) { printf("~text: errno %d text.a.data %p\n", errno, (void *)text->a.data); char_array_(&text->a); printf("~text: errno %d\n", errno); }
|
void text_(struct text *const text) { char_array_(&text->a); }
|
||||||
char *text_append_file(struct text *text, const char *const fn)
|
char *text_append_file(struct text *text, const char *const fn)
|
||||||
{ return append_file(&text->a, fn); }
|
{ return append_file(&text->a, fn); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user