Hi
I want to graph some with gnuplot, everything works only the xrange not. The problem is quotes where to place what
I have this
the xrange must look like this
set xrange ["2011-01-02_10:20:00":"2011-01-03_10:20:00"]
#!/usr/bin/gnuplot
datey="`date +%Y-%m-%d --date='1 days ago'`"
tijd="`date +%H:%M:%S`"
daten="`date +%Y-%m-%d`"
set terminal png transparent small size 950,400 crop
set output '/var/www/temp/testje.png'
set xdata time
set timefmt '%Y-%m-%d_%H:%M:%S'
set xrange ["$datey"_"$tijd":"$daten"_"$tijd"]
I get
gnuplot> set xrange ["$datey"_"$tijd":"$daten"_"$tijd"]
^
':' or keyword 'to' expected
Any ideas are welcome
gnuplot question
Re: gnuplot question
Oldskool thought, have you tried to backslash the : ?
2. Or perhaps skip the : and use the word to including the use of some spaces.
3. Or perhaps the strings shouldn't be qouted but the : does need quotes?
Code: Select all
set xrange ["$datey"_"$tijd"\:"$daten"_"$tijd"]
3. Or perhaps the strings shouldn't be qouted but the : does need quotes?
If you can't fix it with a hammer, you've got an electrical problem!
Fibaro HC2, various z-wave switching, alerting, detection modules.
ELV FHT80b heating system.
Fibaro HC2, various z-wave switching, alerting, detection modules.
ELV FHT80b heating system.
Re: gnuplot question
Code: Select all
############################
# Display the on and off values off an FS20 device
# Corresponding FileLog definition:
# define fs20log FileLog /var/log/fhem/fs20dev-%Y-%U.log fs20dev
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set title '<TL>'
set ytics ("Off" 0, "On" 1)
set y2tics ("Off" 0, "On" 1)
set yrange [-0.1:1.1]
set y2range [-0.1:1.1]
set ylabel "Position"
set y2label "Position"
#FileLog 3::0:$fld[2]eq"on"?1:0
plot "< awk '{print $1, $3==\"on\"? 1 : 0; }' <IN>"\
using 1:2 notitle with steps
Another thing that I noticed:
Code: Select all
#!/usr/bin/gnuplot
datey="`date +%Y-%m-%d --date='1 days ago'`"
tijd="`date +%H:%M:%S`"
daten="`date +%Y-%m-%d`"
set terminal png transparent small size 950,400 crop
set output '/var/www/temp/testje.png'
set xdata time
set timefmt '%Y-%m-%d_%H:%M:%S'
set xrange ["$datey"_"$tijd":"$daten"_"$tijd"]
Code: Select all
#!/usr/bin/gnuplot
set datey="`date +%Y-%m-%d --date='1 days ago'`"
set tijd="`date +%H:%M:%S`"
set daten="`date +%Y-%m-%d`"
set terminal png transparent small size 950,400 crop
set output '/var/www/temp/testje.png'
set xdata time
set timefmt '%Y-%m-%d_%H:%M:%S'
set xrange ["$datey"_"$tijd":"$daten"_"$tijd"]
If you can't fix it with a hammer, you've got an electrical problem!
Fibaro HC2, various z-wave switching, alerting, detection modules.
ELV FHT80b heating system.
Fibaro HC2, various z-wave switching, alerting, detection modules.
ELV FHT80b heating system.
Re: gnuplot question
Any update Richard?
Did you get it working and what was the error?
Did you get it working and what was the error?
If you can't fix it with a hammer, you've got an electrical problem!
Fibaro HC2, various z-wave switching, alerting, detection modules.
ELV FHT80b heating system.
Fibaro HC2, various z-wave switching, alerting, detection modules.
ELV FHT80b heating system.
Re: gnuplot question
Well now it works with this config
#!/usr/bin/gnuplot
datey="`date +%Y-%m-%d_%H:%M:%S --date='1 days ago'`"
daten="`date +%Y-%m-%d_%H:%M:%S`"
set terminal png size 350,100 x101010 x808080 xcd0000 xcd0000 x78a7fc tiny
set output '/var/www/temp/buitentemp.png'
set xdata time
set timefmt '%Y-%m-%d_%H:%M:%S'
set xrange [datey:daten]
set xlabel " "
set ytics nomirror
set format x "%a\n%H:%M%"
set border 0
set key off
set y2tics
set title 'Outside'
plot "< awk '/T:/ {print $1, $4}' /var/log/fhem/buiten-2011.log" using 1:2 axes x1y2 title 'Measured temperature' with lines lw 1, "< awk '/H:/ {print $1, $
#!/usr/bin/gnuplot
datey="`date +%Y-%m-%d_%H:%M:%S --date='1 days ago'`"
daten="`date +%Y-%m-%d_%H:%M:%S`"
set terminal png size 350,100 x101010 x808080 xcd0000 xcd0000 x78a7fc tiny
set output '/var/www/temp/buitentemp.png'
set xdata time
set timefmt '%Y-%m-%d_%H:%M:%S'
set xrange [datey:daten]
set xlabel " "
set ytics nomirror
set format x "%a\n%H:%M%"
set border 0
set key off
set y2tics
set title 'Outside'
plot "< awk '/T:/ {print $1, $4}' /var/log/fhem/buiten-2011.log" using 1:2 axes x1y2 title 'Measured temperature' with lines lw 1, "< awk '/H:/ {print $1, $