#+begin_src elisp (save-excursion (let ((old-value org-confirm-babel-evaluate)) (setq org-confirm-babel-evaluate nil) (org-update-all-dblocks) (org-show-all) (org-next-block 1) (org-babel-execute-src-block) (setq org-confirm-babel-evaluate old-value))) #+end_src #+begin_src elisp (setq org-capture-templates '(("j" "Journal" entry (file+headline "~/tracking/tracking.org" "Journal") "* %t :PROPERTIES: :exercise: :sleep: :nicotine: :distress: :missed: :pain: :END: "))) #+end_src #+begin_src gnuplot :var data=mydata # clear graphics from any previous run reset # define output parameters set terminal svg font "Arial" size 900,900 set output './example.svg' # use org-mode format for input set datafile separator "\t" set timefmt "%Y-%m-%d" # set up for time series data set xdata time set x2tics 1 format '' scale 0 # one X tick per day set xtics 24*60*60 # vertical line on each day set grid xtics # one Y tick every five points set ytics 5 # rotate labels to fit better set xtics rotate by 60 right set key box lc 'gray60' set xtics format "%a %m/%d" set yrange [0:40] set linetype 1 lw 2 lc rgb 'forest-green' ps 1 pt 9 set linetype 2 lw 2 lc rgb 'purple' ps 1 pt 1 set linetype 3 lw 2 lc rgb 'dark-yellow' ps 1 pt 1 set linetype 4 lw 2 lc rgb 'dark-pink' ps 1 pt 1 set linetype 5 lw 2 lc rgb 'red' ps 1 pt 11 set linetype 6 lw 2 lc rgb 'orange' ps 1 pt 1 set linetype 7 lw 1 lc rgb 'forest-green' set arrow 7 from graph 0, first 20 to graph 1, first 20 lt 7 dt '..' set label "20" at graph 0.52, first 20 font 'Arial,16' tc rgb 'forest-green' set linetype 8 lw 1 lc rgb 'purple' set arrow 8 from graph 0, first 8 to graph 1, first 8 lt 8 dt '..' set label "8" at graph 0.52, first 8 font 'Arial,16' tc rgb 'purple' set linetype 9 lw 1 lc rgb 'dark-yellow' set arrow 9 from graph 0, first 5 to graph 1, first 5 lt 9 dt '..' set label "5" at graph 0.52, first 5 font 'Arial,16' tc rgb 'dark-yellow' plot data using 1:($2 == 0 ? NaN : $2) with points title 'exercise (minutes)' lt 1, \ data using 1:3 with lines title 'sleep (hours)' lt 2, \ data using 1:4 with lines title 'nicotine (doses)' lt 3, \ data using 1:5 with lines title 'distress (scale)' lt 4, \ data using 1:($6 == 0 ? NaN : $6) with points title 'missed (doses)' lt 5, \ data using 1:7 with lines title 'pain (scale)' lt 6 #+end_src #+RESULTS: #+BEGIN: columnview :hlines 1 :id myid #+tblname: mydata | Date | exercise minutes | sleep hours | nicotine doses | distress scale | missed doses | pain scale | |------------------+------------------+-------------+----------------+----------------+--------------+------------| | | | | | | | | | [2022-09-13 Tue] | 0 | 12 | 8 | 5 | 0 | 0 | | [2022-09-14 Wed] | 0 | 12 | 7 | 4 | 0 | 0 | | [2022-09-15 Thu] | 20 | 12 | 8 | 3 | 1 | 0 | | [2022-09-16 Fri] | 15 | 14 | 5 | 3 | 0 | 0 | | [2022-09-17 Sat] | 30 | 12 | 7 | 4 | 0 | 1 | | [2022-09-18 Sun] | 15 | 9 | 7 | 5 | 0 | 2 | | [2022-09-19 Mon] | 0 | 7 | 6 | 6 | 0 | 3 | | [2022-09-20 Tue] | 20 | 8 | 7 | 4 | 0 | 3 | | [2022-09-21 Wed] | 15 | 10 | 5 | 3 | 0 | 3 | | [2022-09-22 Thu] | 20 | 11 | 6 | 3.5 | 0 | 3 | | [2022-09-23 Fri] | 0 | 9 | 6 | 3 | 0 | 3 | | [2022-09-24 Sat] | 10 | 13 | 6 | 2 | 0 | 3 | | [2022-09-25 Sun] | 0 | 8.5 | 5 | 2 | 0 | 2 | | [2022-09-26 Mon] | 15 | 13 | 7 | 6 | 0 | 2 | | [2022-09-27 Tue] | 0 | 10 | 5 | 5 | 1 | 2 | | [2022-09-28 Wed] | 30 | 10 | 5 | 3 | 0 | 2 | | [2022-09-29 Thu] | 0 | 12 | 4 | 3 | 0 | 2 | | [2022-09-30 Fri] | 20 | 6 | 4 | 4 | 0 | 2 | | [2022-10-01 Sat] | 10 | 7.5 | 6 | 3 | 0 | 2 | | [2022-10-02 Sun] | 15 | 8 | 7 | 2 | 0 | 2 | | [2022-10-03 Mon] | 0 | 6 | 5 | 2 | 0 | 2 | | [2022-10-04 Tue] | 0 | 8.5 | 5 | 4 | 0 | 2 | | [2022-10-05 Wed] | 15 | 8 | 5 | 4 | 0 | 2 | | [2022-10-06 Thu] | 25 | 8.5 | 5 | 4 | 0 | 2 | | [2022-10-07 Fri] | 25 | 6 | 5 | 3 | 0 | 2 | | [2022-10-08 Sat] | 20 | 9 | 0 | 3 | 0 | 2 | | [2022-10-09 Sun] | 0 | 6 | 3 | 4 | 0 | 2 | | [2022-10-10 Mon] | 0 | 6 | 5 | 5 | 0 | 2 | | [2022-10-11 Tue] | 0 | 6.5 | 4 | 4 | 0 | 2 | | [2022-10-12 Wed] | 0 | 3 | 0 | 3 | 0 | 2 | | [2022-10-13 Thu] | 0 | 4.5 | 0 | 3 | 0 | 3 | | [2022-10-14 Fri] | 0 | 4 | 0 | 3 | 0 | 3 | | [2022-10-15 Sat] | 0 | 5 | 0 | 3 | 1 | 2 | | [2022-10-16 Sun] | 0 | 2 | 0 | 4 | 0 | 1 | | [2022-10-17 Mon] | 0 | 4.5 | 0 | 3 | 0 | 2 | #+END: * Journal :PROPERTIES: :columns: %timestamp(Date) %exercise(exercise minutes) %sleep(sleep hours) %nicotine(nicotine doses) %distress(distress scale) %missed(missed doses) %pain(pain scale) :ID: myid :END: ** <2022-09-13 Tue> :PROPERTIES: :exercise: 0 :sleep: 12 :nicotine: 8 :distress: 5 :missed: 0 :pain: 0 :END: ** <2022-09-14 Wed> :PROPERTIES: :exercise: 0 :sleep: 12 :nicotine: 7 :distress: 4 :missed: 0 :pain: 0 :END: ** <2022-09-15 Thu> :PROPERTIES: :exercise: 20 :sleep: 12 :nicotine: 8 :distress: 3 :missed: 1 :pain: 0 :END: ** <2022-09-16 Fri> :PROPERTIES: :exercise: 15 :sleep: 14 :nicotine: 5 :distress: 3 :missed: 0 :pain: 0 :END: ** <2022-09-17 Sat> :PROPERTIES: :exercise: 30 :sleep: 12 :nicotine: 7 :distress: 4 :missed: 0 :pain: 1 :END: ** <2022-09-18 Sun> :PROPERTIES: :exercise: 15 :sleep: 9 :nicotine: 7 :distress: 5 :missed: 0 :pain: 2 :END: ** <2022-09-19 Mon> :PROPERTIES: :exercise: 0 :sleep: 7 :nicotine: 6 :distress: 6 :missed: 0 :pain: 3 :END: ** <2022-09-20 Tue> :PROPERTIES: :exercise: 20 :sleep: 8 :nicotine: 7 :distress: 4 :missed: 0 :pain: 3 :END: ** <2022-09-21 Wed> :PROPERTIES: :exercise: 15 :sleep: 10 :nicotine: 5 :distress: 3 :missed: 0 :pain: 3 :END: ** <2022-09-22 Thu> :PROPERTIES: :exercise: 20 :sleep: 11 :nicotine: 6 :distress: 3.5 :missed: 0 :pain: 3 :END: ** <2022-09-23 Fri> :PROPERTIES: :exercise: 0 :sleep: 9 :nicotine: 6 :distress: 3 :missed: 0 :pain: 3 :END: ** <2022-09-24 Sat> :PROPERTIES: :exercise: 10 :sleep: 13 :nicotine: 6 :distress: 2 :missed: 0 :pain: 3 :END: ** <2022-09-25 Sun> :PROPERTIES: :exercise: 0 :sleep: 8.5 :nicotine: 5 :distress: 2 :missed: 0 :pain: 2 :END: ** <2022-09-26 Mon> :PROPERTIES: :exercise: 15 :sleep: 13 :nicotine: 7 :distress: 6 :missed: 0 :pain: 2 :END: ** <2022-09-27 Tue> :PROPERTIES: :exercise: 0 :sleep: 10 :nicotine: 5 :distress: 5 :missed: 1 :pain: 2 :END: ** <2022-09-28 Wed> :PROPERTIES: :exercise: 30 :sleep: 10 :nicotine: 5 :distress: 3 :missed: 0 :pain: 2 :END: ** <2022-09-29 Thu> :PROPERTIES: :exercise: 0 :sleep: 12 :nicotine: 4 :distress: 3 :missed: 0 :pain: 2 :END: ** <2022-09-30 Fri> :PROPERTIES: :exercise: 20 :sleep: 6 :nicotine: 4 :distress: 4 :missed: 0 :pain: 2 :END: ** <2022-10-01 Sat> :PROPERTIES: :exercise: 10 :sleep: 7.5 :nicotine: 6 :distress: 3 :missed: 0 :pain: 2 :END: ** <2022-10-02 Sun> :PROPERTIES: :exercise: 15 :sleep: 8 :nicotine: 7 :distress: 2 :missed: 0 :pain: 2 :END: ** <2022-10-03 Mon> :PROPERTIES: :exercise: 0 :sleep: 6 :nicotine: 5 :distress: 2 :missed: 0 :pain: 2 :END: ** <2022-10-04 Tue> :PROPERTIES: :exercise: 0 :sleep: 8.5 :nicotine: 5 :distress: 4 :missed: 0 :pain: 2 :END: ** <2022-10-05 Wed> :PROPERTIES: :exercise: 15 :sleep: 8 :nicotine: 5 :distress: 4 :missed: 0 :pain: 2 :END: ** <2022-10-06 Thu> :PROPERTIES: :exercise: 25 :sleep: 8.5 :nicotine: 5 :distress: 4 :missed: 0 :pain: 2 :END: ** <2022-10-07 Fri> :PROPERTIES: :exercise: 25 :sleep: 6 :nicotine: 5 :distress: 3 :missed: 0 :pain: 2 :END: ** <2022-10-08 Sat> :PROPERTIES: :exercise: 20 :sleep: 9 :nicotine: 0 :distress: 3 :missed: 0 :pain: 2 :END: ** <2022-10-09 Sun> :PROPERTIES: :exercise: 0 :sleep: 6 :nicotine: 3 :distress: 4 :missed: 0 :pain: 2 :END: ** <2022-10-10 Mon> :PROPERTIES: :exercise: 0 :sleep: 6 :nicotine: 5 :distress: 5 :missed: 0 :pain: 2 :END: ** <2022-10-11 Tue> :PROPERTIES: :exercise: 0 :sleep: 6.5 :nicotine: 4 :distress: 4 :missed: 0 :pain: 2 :END: ** <2022-10-12 Wed> :PROPERTIES: :exercise: 0 :sleep: 3 :nicotine: 0 :distress: 3 :missed: 0 :pain: 2 :END: ** <2022-10-13 Thu> :PROPERTIES: :exercise: 0 :sleep: 4.5 :nicotine: 0 :distress: 3 :missed: 0 :pain: 3 :END: ** <2022-10-14 Fri> :PROPERTIES: :exercise: 0 :sleep: 4 :nicotine: 0 :distress: 3 :missed: 0 :pain: 3 :END: ** <2022-10-15 Sat> :PROPERTIES: :exercise: 0 :sleep: 5 :nicotine: 0 :distress: 3 :missed: 1 :pain: 2 :END: ** <2022-10-16 Sun> :PROPERTIES: :exercise: 0 :sleep: 2 :nicotine: 0 :distress: 4 :missed: 0 :pain: 1 :END: ** <2022-10-17 Mon> :PROPERTIES: :exercise: 0 :sleep: 4.5 :nicotine: 0 :distress: 3 :missed: 0 :pain: 2 :END: