X-axis has wrong origin
Dave Horsfall <[email protected]> Tue, 11 Jul 2023 08:43:52 +1000 (EST)
| Newsgroups | gmane.comp.graphics.gnuplot.user |
|---|---|
| Message-ID | <[email protected]> |
Gnuplot 5.4 patchlevel 8, MacBook Pro (mid-2010) on High Sierra 10.13.6. See http://www.horsfall.org/health.pdf and note how the X-axis starts on 01 Dec 2022 and not 01 Jan 2023 as specified in the data file (attached). I can "fix" it by commenting out the first line of data as demonstrated. The command script is also attached. Seems like a bug to me... Thanks. -- Dave _______________________________________________ gnuplot-info mailing list [email protected] Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
health.gp
(text/plain, 4.9 KB)
#
# Daily elf-check readings for weight/BP etc
#
reset # I may have been stuffing around interactively
set title "Dave's Daily Health Checks"
# set timestamp
# set timestamp top
# Take it out completely - it's irrelevant in this context.
#
# Futz around with the legend a bit.
#
set key reverse Left
set key box outside
set key below
set terminal aqua title "health" # Why can't I just say "+title"?
#
# TODO:
#
# Annotate points.
# Etc - see old graphs for notes.
# Try smoothing weight & girth.
# Plot 5BX too; 1-12 for chart #1 (div/10), "x" -> 0 (no ex)? Hollow grey boxes.
#
#
# BMI stuff (kg/m^2).
#
#height = 182 # A bit over 6ft - must check
height = 180 # I seem to have shrunk? Damn! Update every so often...
bmi(weight) = weight/((height/100.0)**2)
#
# Basal metabolic rate (BMR). For men, the BMR was 66 + (13.7xW) +
# (5xH) – (6.8 x A). W is the person’s weight in kilograms, H is the
# person’s height in centimetres, and A is the person’s age in years.
# It's changed a bit... Anyway, it's kcal(Cal)/day. NB: males only.
#
# Consider using kilojoules instead (a MJ is 239kcal).
#
year = `date +%Y` # Tiny chance of wrap-around here; not worth fixing
month = `date +%-m` # Rampant octal brain-death...
age = int(year - 1952 + (month-10)/12.0 + 0.5) # XXX Wraps around in Jan! Need + 12 mod 12
bmr1(weight) = ((13.7*weight) + (5.0*height) - (6.8*age) + 66) # Orig H-B
bmr2(weight) = ((13.4*weight) + (4.8*height) - (5.7*age) + 88) # Rev H-B
# This one is now in vogue; all pretty much the same anyway...
bmr3(weight) = ((10.0*weight) + (6.3*height) - (5.0*age) + 5) # M StJ
#
# Funcs not defined but ought to be.
#
avg(a, b) = (a + b)/2.0 # Pedantically "arithmetic mean"...
#
# Useful macros.
#
WEIGHT = "$3"
GIRTH = "$4"
SYS = "$5"
DIA = "$6"
HR = "$7"
BX = "$8"
#set datafile missing "x" # Why not working? Because it isn't missing :-)
set style data lines # NB: needs to be explicit with user funcs
set xdata time
set timefmt "%d/%m/%y"
set xtics format "%d %b\n%Y"
# set xtics format "%b\n%Y"
# set xtics format "%d %b"
# set xtics format "%d/%m"
# set xtics format "%d/%m\n%Y"
set xtics nomirror
# XXX Need to get colours right
set ytics add ("(HR min) 60" 60)
set ytics add ("(HR max) 100" 100)
# set ytics add ("(BMI max) 25" 25) # Was 30
# set ytics add ("(BMI min) 18" 18) # Was 20
set y2tics add ("100 (Sys min)" 100)
set y2tics add ("140 (Sys max)" 140)
set y2tics add ("60 (Dia min)" 60)
set y2tics add ("90 (Dia max)" 90)
#set y2tics nomirror
set yrange [0:160]
set y2range [0:160] # XXX This worked w/o this since 2013 until 1/2/21...
set grid # XXX And don't draw extra grid line
datafile = "health.dat"
#
# There is no correlation with time, but BP & HR is interesting.
#
#
# Legend jiggered to correspond with plots.
# Dropped Sys-Dia, Sys/HR, Dia/HR.
#
# For the pedantic, errorbars are really std.dev/sqrt(samp.size), but
# I'm taking it as +/- 2cm, because of lack of consistency.
#
# To plot lines on errorbars, plot twice, but no need.
#
# Tried sqrt (√) of (Sys-Dia)*HR and µ(Sys,Dia) but too similar (as expected).
#
# Dropped Weight, Girth, BMI and BMR etc until they change signif.
# Put weight back. Put BMI/BMR back.
# datafile using 1:(@GIRTH):(@GIRTH-2):(@GIRTH+2) \
# with errorbars lt 7 title 'Girth (± 2cm)', \
# datafile using 1:(@SYS-@DIA)*10/@HR \
# with lines lt 9 title '(Sys-Dia)/HR', \
# datafile using 1:(avg(@SYS, @DIA)*10)/@HR \
# with lines lt 5 title 'µ(Sys,Dia)/HR', \
# datafile using 1:(@GIRTH):(@GIRTH-2):(@GIRTH+2) \
# with errorbars lt rgb "grey" title 'Girth (± 1cm)', \
#
# Dropped '(Sys-Dia)*HR/100)' and 'µ(Sys,Dia)*HR/1000'.
#
# datafile using 1:(@SYS-@DIA)*@HR/100.0 \
# with lines lt rgb "yellow" title '(Sys-Dia)*HR/100', \
# datafile using 1:(avg(@SYS, @DIA)*@HR/1000.0) \
# with lines lt rgb "grey" title 'µ(Sys,Dia)*HR/1000', \
#
# Broken parsing needs a dummy line here.
#
# 5BX too; 1-12 for chart #1 (div/10), "x" -> 0 (no ex)? Hollow grey boxes.
plot \
datafile using 1:(@SYS) lt rgb "red" title 'Systolic', \
datafile using 1:(@DIA) lt rgb "red" title 'Diastolic', \
datafile using 1:(@HR) with lines lt rgb "green" title 'Heart', \
datafile using 1:(@WEIGHT) with lines lt rgb "blue" title 'Weight', \
0 lt -1 notitle # Dummy so I can move above around
# datafile using 1:(bmi(@WEIGHT)) with lines lt rgb "cyan" title 'BMI (kg/m^2)', \
# datafile using 1:(bmr3(@WEIGHT))/100.0 \
# with lines lt 13 title 'BMR/100 (Cal/day)', \
# Pretty meaningless; I pump the same volume of blood.
# datafile using 1:(sqrt(@SYS*@HR)) with lines lt rgb 'grey' \
# title '√(Sys*HR)', \
# See older script
#plot datafile using 1:($5) title 'Sys', \
# datafile using 1:($6) title 'Dia', \
# datafile using 1:($7) title 'HR'
## datafile using 1:($7) axes x1y2 title 'HR'
health.dat
(text/plain, 8.5 KB)
# Kludge below to get graph to start at 1/1 (not plotted) #1/1/23 1915 86.7 106 101 68 98 9 # 3m, no w 1/1/23 1915 86.7 106 101 68 98 9 # 3m, no w 2/1/23 1845 86.7 106 119 70 97 9 # 3m, no w 3/1/23 1900 86.3 106 119 69 82 9 # 3m, w 4/1/23 1930 86.3 106 121 70 83 9 # 3m, no w 5/1/23 1845 86.3 106 122 80 86 0 # 3m, no w 6/1/23 1830 85.9 106 87 54 76 0 # 3m, w 7/1/23 1930 87.5 106 125 68 77 9 # 3m, no w 8/1/23 1800 88.2 106 146 78 69 9 # 3m, no w 9/1/23 1945 85.7 106 82 49 81 9 # 3m, w 10/1/23 1900 86.8 106 131 65 83 0 # 3m, no w 11/1/23 1845 86.3 106 116 79 91 9 # 3m, no w 12/1/23 1900 85.7 106 117 77 90 9 # 3m, no w 13/1/23 2000 84.7 106 86 58 86 9 # 3m, w 14/1/23 1815 85.9 106 95 58 94 0 # 3m, no w 15/1/23 1900 87.1 106 123 75 87 9 # 3m, no w 16/1/23 2355 85.2 106 87 56 80 10 # 3m, w 17/1/23 1830 86.7 106 126 80 95 0 # 3m, no w 18/1/23 1845 86.9 106 130 73 82 10 # 3m, no w 19/1/23 1800 86.1 106 137 89 87 10 # 3m, no w 20/1/23 1830 86.1 106 76 49 88 10 # 3m, w 21/1/23 1915 86.7 106 101 68 82 0 # 3m, no w 22/1/23 1800 86.6 106 135 72 82 10 # 3m, no w 23/1/23 2000 86.5 106 75 46 81 10 # 3m, w 24/1/23 1830 87.0 106 105 65 76 10 # 3m, no w 25/1/23 1845 86.1 106 118 71 85 10 # 3m, no w 26/1/23 1900 85.9 106 118 69 97 0 # 3m, no w 27/1/23 x x x x x x 0 # 3m, w 28/1/23 1900 85.8 106 114 71 91 0 # 3m, no w 29/1/23 1815 86.6 106 115 67 85 0 # 3m, no w 30/1/23 2215 85.6 106 95 59 78 8 # 3m, w 31/1/23 1800 86.0 106 113 68 95 8 # 3m, no w 1/2/23 1815 86.4 106 131 76 71 9 # 3m, no w 2/2/23 1830 86.1 106 124 70 79 9 # 3m, no w 3/2/23 1900 x x 105 61 84 0 # 3m, w 4/2/23 1845 85.5 106 98 62 87 0 # 3m. no w 5/2/23 1800 85.7 106 128 74 71 8 # 3m, no w 6/2/23 2000 85.1 106 94 59 83 8 # 3m, w 7/2/23 1815 85.1 106 95 61 94 0 # 3m, no w 8/2/23 2200 85.5 106 105 64 82 0 # 3m, w 9/2/23 1845 87.3 106 129 74 72 7 # 3m, no w 10/2/23 1830 87.6 106 97 56 75 0 # 3m, w 11/2/23 1900 87.5 106 99 56 86 7 # 3m, w 12/2/23 1800 87.7 106 137 78 85 7 # 3m, no w 13/2/23 1900 87.1 106 90 54 83 0 # 3m, w 14/2/23 1730 87.1 106 76 45 97 0 # 3m, no w 15/2/23 1830 86.1 106 124 83 88 7 # 3m, no w 16/2/23 1930 85.7 106 93 50 80 0 # 3m, w 17/2/23 1845 86.2 106 103 69 94 0 # 3m, w 18/2/23 2000 85.6 106 108 61 80 0 # 3m, no w 19/2/23 1830 86.7 106 157 94 105 0 # 3m, no w 20/2/23 1815 85.9 106 121 73 97 0 # 3m, no w 21/2/23 1830 86.7 106 123 65 80 0 # 3m, no w 22/2/23 1830 85.9 106 120 78 91 0 # 3m, no w 23/2/23 1845 86.4 106 128 73 66 0 # 3m, w 24/2/23 1745 86.8 106 90 55 82 0 # No d, w 25/2/23 1830 87.9 106 118 73 81 0 # 3m, no w 26/2/23 1815 87.5 106 127 72 68 0 # 3m, no w 27/2/23 2200 85.9 106 93 57 82 1 # 3m, w 28/2/23 1820 87.7 106 97 58 87 0 # 3m, no w 1/3/23 1830 87.2 106 133 79 91 0 # 3m, no w 2/3/23 1900 87.2 106 120 69 83 1 # 3m, no w 3/3/23 1815 86.6 106 83 49 80 1 # 3m, w 4/3/23 1945 85.8 106 90 60 87 0 # 3m, no w 5/3/23 1815 86.7 106 134 74 98 1 # 3m, no w 6/3/23 1830 88.1 106 118 63 70 1 # 3m, no w 7/3/23 1815 87.2 106 123 64 75 1 # 3m, no w 8/3/23 1900 86.5 106 135 75 86 1 # 3m, no w 9/3/23 1815 86.5 106 131 76 77 1 # 3m, no w 10/3/23 1815 86.5 106 80 50 85 1 # 3m, w 11/3/23 1945 85.5 106 83 50 97 1 # No l, no w 12/3/23 1915 86.1 106 118 67 102 0 # 3m, no w 13/3/23 1945 86.8 106 90 53 91 2 # 3m, w 14/3/23 2010 86.3 106 100 63 79 0 # 3m, no w 15/3/23 1930 87.7 106 132 69 103 2 # 3m. w 16/3/23 2000 86.6 106 114 67 100 0 # 3m, no w 17/3/23 1815 88.4 106 114 67 92 0 # 3m, w 18/3/23 1830 87.8 106 97 59 88 1 # 3m, no w 19/3/23 1830 87.4 106 145 83 92 1 # 3m, no w 20/3/23 1800 87.6 106 128 78 90 2 # 3m, no w 21/3/23 1830 88.1 106 131 77 75 0 # 3m, no w 22/3/23 1815 87.3 106 116 71 87 1 # 3m, w 23/3/23 1800 87.3 106 130 68 74 0 # 3m, no w 24/3/23 1900 85.7 106 81 52 72 1 # 3m, w 25/3/23 1825 86.3 106 100 60 86 1 # 3m, no w 26/3/23 1830 88.1 106 131 75 91 2 # 3m, no w 27/3/23 1845 86.5 106 98 62 90 2 # 3m, w 28/3/23 x x x x x x 0 # 3m, no w 29/3/23 x x x x x x 2 # 3m, no w 30/3/23 x x x x x x 0 # 3m, no w 31/3/23 x x x x x x 0 # 3m, w 1/4/23 1810 84.7 106 120 76 81 1 # 3m, no w 2/4/23 1700 81.3 106 162 99 97 0 # 3m, no w 3/4/23 1745 86.1 106 143 82 94 0 # 3m, no w 4/4/23 1900 85.6 106 105 67 107 0 # 3m, no w 5/4/23 1845 85.7 106 119 73 102 0 # 3m, no w 6/4/23 1745 87.2 106 94 66 82 0 # 3m, w 7/4/23 1815 87.5 106 109 66 74 0 # 3m, no w 8/4/23 1930 87.9 106 118 64 73 0 # 3m, w 9/4/23 1815 88.4 106 136 76 63 0 # 3m, no w 10/4/23 1815 87.8 106 135 74 67 1 # 3m, no w 11/4/23 1745 86.0 106 92 56 81 1 # 3m, w 12/4/23 1815 88.7 106 139 82 81 1 # 3m, no w 13/4/23 1845 88.1 106 133 73 67 1 # 3m, no w 14/4/23 1815 87.4 106 97 54 88 1 # 3m, w 15/4/23 1745 87.1 106 97 55 92 1 # 3m, w 16/4/23 1830 89.5 106 141 79 78 1 # 3m, no w 17/4/23 1745 86.9 106 102 58 82 2 # 3m, w 18/4/23 1830 88.7 106 135 78 75 2 # 3m, no w 19/4/23 1900 86.4 106 89 55 87 2 # 3m, w 20/4/23 1845 88.4 106 100 61 92 2 # 3m, w 21/4/23 1815 88.0 106 99 59 80 0 # 3m, w 22/4/23 1800 88.0 106 106 66 95 2 # 3m, w 23/4/23 1845 89.3 106 143 78 73 2 # 3m, no w 24/4/23 1930 87.4 106 83 55 78 3 # 3m, w 25/4/23 1830 88.2 106 122 68 91 3 # 3m, no w 26/4/23 1945 88.6 106 125 69 80 0 # 3m, no w 27/4/23 1830 88.1 106 124 78 85 3 # 3m, no w 28/4/23 2000 88.1 106 86 52 86 0 # 3m, w 29/4/23 1845 88.9 106 126 70 80 3 # 3m, no w 30/4/23 1800 89.4 106 130 76 72 3 # 3m, no w 1/5/23 1845 87.2 106 97 59 88 0 # 3m, w 2/5/23 1830 89.3 106 136 76 76 3 # 3m, no w 3/5/23 1815 88.1 106 137 76 72 3 # 3m, no w 4/5/23 1830 88.1 106 137 76 80 3 # 3m, no w 5/5/23 x x x x x x 3 # 3m, w 6/5/23 1830 88.3 106 83 47 76 x # 3m, w 7/5/23 1845 87.7 106 131 68 80 3 # 3m, no w 8/5/23 1900 88.4 106 101 57 87 4 # 3m, w 9/5/23 1800 88.1 106 98 58 91 x # 3m, w 10/5/23 1830 89.2 106 126 63 85 4 # 3m, no w 11/5/23 x 88.4 106 x x x 4 # 3m, w 12/5/23 1745 88.8 106 110 69 91 x # 3m, w 13/5/23 1815 89.1 106 155 84 90 4 # 3m, no w 14/5/23 1745 87.4 106 134 76 91 4 # 3m, no w 15/5/23 1845 86.7 106 100 60 81 0 # 3m, no w 16/5/23 1845 87.5 106 104 61 73 5 # 3m, no w 17/5/23 1845 87.5 106 109 66 81 0 # 3m, no w 18/5/23 1745 87.5 106 111 67 67 0 # 3m, no w 19/5/23 x 85.3 x x x x 5 # 3m, w 20/5/23 1800 87.0 106 107 66 73 0 # 3m, w 21/5/23 1815 86.7 106 116 72 94 x # 3m, no w 22/5/23 1850 86.7 106 120 71 87 5 # 3m, w 23/5/23 1945 87.9 106 137 77 69 5 # 3m, no w 24/5/23 1930 87.3 106 98 55 81 x # 3m, no w 25/5/23 1815 88.0 106 132 68 85 x # 3m, no w 26/5/23 1800 86.8 106 100 57 86 5 # 3m, w 27/5/23 1915 86.5 106 106 64 98 x # 3m, w 28/5/23 1815 87.7 106 132 72 85 x # 3m, no w 29/5/23 1815 88.1 106 133 72 81 5 # 3m, no w 30/5/23 1715 x x 83 52 90 5 # 3m, w 31/5/23 1830 87.9 106 95 54 95 x # 3m, w 1/6/23 1800 88.5 106 142 76 80 5 # 3m, w 2/6/23 x x x x x x 5 # No d, w 3/6/23 1900 87.4 106 97 55 86 5 # 3m, w 4/6/23 1830 88.6 106 143 74 90 x # 3m, no w 5/6/23 1815 88.2 106 129 69 76 x # 3m, w 6/6/23 1845 88.2 106 134 76 71 5 # 3m, no w 7/6/23 1830 87.8 106 133 77 83 5 # 3m, no w 8/6/23 1845 87.8 106 133 77 92 x # 3m, no w 9/6/23 1945 87.1 106 139 90 95 x # 3m, no w 10/6/23 2030 86.8 106 98 60 75 x # 3m, w 11/6/23 1845 86.8 106 122 75 100 x # 3m, no w 12/6/23 1815 86.8 106 127 76 83 1 # 3m, no w 13/6/23 x 86.8 106 x x x 2 # 3m, w 14/6/23 1815 88.0 106 126 73 76 3 # 3m, w 15/6/23 1815 88.4 106 138 73 73 x # 3m, now 16/6/23 1845 88.0 106 86 46 98 3 # 3m, w 17/6/23 1930 89.2 106 123 70 76 x # 3m, no w 18/6/23 1830 89.2 106 134 82 75 3 # 3m, no w 19/6/23 1800 88.1 107 97 57 81 3 # 3m, w 20/6/23 1845 89.1 107 128 67 70 3 # 3m, no w 21/6/23 1900 88.8 107 108 63 73 3 # 3m, w 22/6/23 1845 88.8 107 130 71 73 x # 3m, no w 23/6/23 1815 88.8 107 105 56 76 3 # 3m, w 24/6/23 1930 89.5 107 106 58 82 x # 3m, no w 25/6/23 1830 89.9 107 147 80 85 x # 3m, no w 26/6/23 1745 89.3 107 110 60 75 3 # 3m, w 27/6/23 1815 88.8 107 133 76 88 3 # 3m, no w 28/6/23 x x x x x x x # 3m, w 29/6/23 1745 87.8 107 109 57 94 x # 3m, w 30/6/23 1815 88.7 107 133 76 79 x # 3m, w 1/7/23 1900 89.3 107 134 74 70 3 # 3m, no w 2/7/23 1815 88.7 107 126 74 87 3 # 3m, no w 3/7/23 1830 88.5 107 115 58 63 4 # 3m, no w 4/7/23 1800 88.8 107 127 64 72 4 # 3m, w 5/7/23 1830 88.3 107 134 73 83 4 # 3m, no w 6/7/23 1830 88.3 107 120 69 65 4 # 3m, no w 7/7/23 1745 87.9 107 116 61 66 4 # 3m, w 8/7/23 1845 88.9 107 119 62 77 4 # 3m, no w 9/7/23 1800 88.9 107 135 73 65 4 # 3m, no w 10/7/23 1715 88.7 107 111 60 65 x # 3m, w # Date Time Wgt Gth Sys Dia HR 5BX # Comments