health-template/example.org

11 KiB

(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)))
(setq org-capture-templates '(("j" "Journal" entry (file+headline "~/tracking/tracking.org" "Journal")
"* %t
:PROPERTIES:
:exercise: 
:sleep: 
:nicotine: 
:distress: 
:missed: 
:pain:
:END:
")))
# 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
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

Journal

<2022-09-13 Tue>

<2022-09-14 Wed>

<2022-09-15 Thu>

<2022-09-16 Fri>

<2022-09-17 Sat>

<2022-09-18 Sun>

<2022-09-19 Mon>

<2022-09-20 Tue>

<2022-09-21 Wed>

<2022-09-22 Thu>

<2022-09-23 Fri>

<2022-09-24 Sat>

<2022-09-25 Sun>

<2022-09-26 Mon>

<2022-09-27 Tue>

<2022-09-28 Wed>

<2022-09-29 Thu>

<2022-09-30 Fri>

<2022-10-01 Sat>

<2022-10-02 Sun>

<2022-10-03 Mon>

<2022-10-04 Tue>

<2022-10-05 Wed>

<2022-10-06 Thu>

<2022-10-07 Fri>

<2022-10-08 Sat>

<2022-10-09 Sun>

<2022-10-10 Mon>

<2022-10-11 Tue>

<2022-10-12 Wed>

<2022-10-13 Thu>

<2022-10-14 Fri>

<2022-10-15 Sat>

<2022-10-16 Sun>

<2022-10-17 Mon>