petterreinholdtsen / battery-stats

Log battery charge (battery-stats-collector), show gnuplot graphs (battery-graph)
GNU General Public License v2.0
27 stars 13 forks source link

gnuplot >=6.x no longer has '-title' argument #40

Open Psykar opened 8 months ago

Psykar commented 8 months ago

As per title.

unrecognized option -title
line 0: Cannot load input from 'Battery Graph'

Or with bash -x

+ gnuplot -persist -title 'Battery Graph'
+ echo 'zero_time_err = sqrt((A/B**2*B_err)**2+(1.0/B*A_err)**2) }'
+ echo 'full_time = (100-A)/B'
+ echo 'g(x) = x<zero_time?(x>full_time?f(x):1/0):1/0'
+ echo 'set xrange [ 758684676 : 758713476 ] noreverse'
+ echo plot '"/tmp/tmp.tk7Rtpedcl" using ($1 - 946733400):($3==2?$2:1/0) smooth unique axis x1y1 title "Plugged in" with lines linecolor rgb "blue" linewidth 3,    "" using ($1 - 946733400):($3==1?$2:1/0) smooth unique axis x1y1 title "Discharging" with lines linecolor rgb "red" linewidth 3,    "" using ($1 - 946733400):($3==0?$2:1/0) smooth unique axis x1y1 title "Unknown" with lines linecolor rgb "gray" linewidth 3 \'
+ true
+ echo ', g(x -(1705388544-946733400) ) title (B<0?sprintf("slope= (%.2f +/- %.2f) %/h", B*3600, B_err*3600):"") lc rgb "black" lt 2 '
unrecognized option -title
line 0: Cannot load input from 'Battery Graph'

Unfortunately I can't interpret what is needed from gnuplots changelog or I'd do an MR.

daniilkk commented 7 months ago

I don't know what is the correct portable fix but if you use qt output (like me) you can just set title like this

tgy commented 5 months ago

Got the same error on the latest git version :-/