#+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: :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 './test.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:30] 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 'orange' ps 1 pt 1 set linetype 6 lw 1 lc rgb 'forest-green' set arrow 6 from graph 0, first 20 to graph 1, first 20 lt 6 dt '..' set label "20" at graph 0.52, first 20 font 'Arial,16' tc rgb 'forest-green' set linetype 7 lw 1 lc rgb 'purple' set arrow 7 from graph 0, first 8 to graph 1, first 8 lt 7 dt '..' set label "8" at graph 0.52, first 8 font 'Arial,16' tc rgb 'purple' set linetype 8 lw 1 lc rgb 'dark-yellow' set arrow 8 from graph 0, first 5 to graph 1, first 5 lt 8 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 with lines title 'pain (scale)' lt 5 #+end_src #+RESULTS: * Data table #+BEGIN: columnview :hlines 1 :id myid #+tblname: mydata | Date | exercise minutes | sleep hours | nicotine doses | distress | pain | tags | |------------------+------------------+-------------+----------------+----------+------+------| | | | | | | | | | [2022-09-30 Fri] | 20 | 6 | 4 | 4 | 2 | | | [2022-10-01 Sat] | 10 | 7.5 | 6 | 3 | 2 | | | [2022-10-02 Sun] | 15 | 8 | 7 | 2 | 2 | | | [2022-10-03 Mon] | 0 | 6 | 5 | 2 | 2 | | | [2022-10-04 Tue] | 0 | 8.5 | 5 | 4 | 2 | | | [2022-10-05 Wed] | 15 | 8 | 5 | 4 | 2 | | | [2022-10-06 Thu] | 25 | 8.5 | 5 | 4 | 2 | | | [2022-10-07 Fri] | 25 | 6 | 5 | 3 | 2 | | | [2022-10-08 Sat] | 20 | 9 | 0 | 3 | 2 | | | [2022-10-09 Sun] | 0 | 6 | 3 | 4 | 2 | | | [2022-10-10 Mon] | 0 | 6 | 5 | 5 | 2 | | | [2022-10-11 Tue] | 0 | 6.5 | 4 | 4 | 2 | | | [2022-10-12 Wed] | 0 | 3 | 0 | 3 | 2 | | | [2022-10-13 Thu] | 0 | 4.5 | 0 | 3 | 3 | | | [2022-10-14 Fri] | 0 | 4 | 0 | 3 | 3 | | | [2022-10-15 Sat] | 0 | 5 | 0 | 3 | 2 | | | [2022-10-16 Sun] | 0 | 2 | 0 | 4 | 1 | | | [2022-10-17 Mon] | 0 | 4.5 | 0 | 3 | 2 | | #+END: * Journal :PROPERTIES: :columns: %timestamp(Date) %exercise(exercise minutes) %sleep(sleep hours) %nicotine(nicotine doses) %distress(distress) %pain(pain) %TAGS(tags) :ID: myid :END: ** <2022-09-30 Fri> :PROPERTIES: :exercise: 20 :sleep: 6 :nicotine: 4 :distress: 4 :pain: 2 :END: ** <2022-10-01 Sat> :PROPERTIES: :exercise: 10 :sleep: 7.5 :nicotine: 6 :distress: 3 :pain: 2 :END: ** <2022-10-02 Sun> :PROPERTIES: :exercise: 15 :sleep: 8 :nicotine: 7 :distress: 2 :pain: 2 :END: ** <2022-10-03 Mon> :PROPERTIES: :exercise: 0 :sleep: 6 :nicotine: 5 :distress: 2 :pain: 2 :END: ** <2022-10-04 Tue> :PROPERTIES: :exercise: 0 :sleep: 8.5 :nicotine: 5 :distress: 4 :pain: 2 :END: ** <2022-10-05 Wed> :PROPERTIES: :exercise: 15 :sleep: 8 :nicotine: 5 :distress: 4 :pain: 2 :END: ** <2022-10-06 Thu> :PROPERTIES: :exercise: 25 :sleep: 8.5 :nicotine: 5 :distress: 4 :pain: 2 :END: ** <2022-10-07 Fri> :PROPERTIES: :exercise: 25 :sleep: 6 :nicotine: 5 :distress: 3 :pain: 2 :END: ** <2022-10-08 Sat> :PROPERTIES: :exercise: 20 :sleep: 9 :nicotine: 0 :distress: 3 :pain: 2 :END: ** <2022-10-09 Sun> :PROPERTIES: :exercise: 0 :sleep: 6 :nicotine: 3 :distress: 4 :pain: 2 :meditation: 0 :END: ** <2022-10-10 Mon> :PROPERTIES: :exercise: 0 :sleep: 6 :nicotine: 5 :distress: 5 :pain: 2 :END: ** <2022-10-11 Tue> :PROPERTIES: :exercise: 0 :sleep: 6.5 :nicotine: 4 :distress: 4 :pain: 2 :END: ** <2022-10-12 Wed> :PROPERTIES: :exercise: 0 :sleep: 3 :nicotine: 0 :distress: 3 :pain: 2 :END: ** <2022-10-13 Thu> :PROPERTIES: :exercise: 0 :sleep: 4.5 :nicotine: 0 :distress: 3 :pain: 3 :END: ** <2022-10-14 Fri> :PROPERTIES: :exercise: 0 :sleep: 4 :nicotine: 0 :distress: 3 :pain: 3 :END: ** <2022-10-15 Sat> :PROPERTIES: :exercise: 0 :sleep: 5 :nicotine: 0 :distress: 3 :pain: 2 :END: ** <2022-10-16 Sun> :PROPERTIES: :exercise: 0 :sleep: 2 :adl: 1 :nicotine: 0 :distress: 4 :missed: 0 :pain: 1 :meditation: 0 :END: ** <2022-10-17 Mon> :PROPERTIES: :exercise: 0 :sleep: 4.5 :adl: 1 :nicotine: 0 :distress: 3 :missed: 0 :pain: 2 :meditation: 0 :END: