Menu

Gnuplot with Sqlite3 - no diagram lines plotted

Help
jolle-pe
2014-12-16
2014-12-16
  • jolle-pe

    jolle-pe - 2014-12-16

    Hello everybody,

    i try to plot some data from a sqlite3 database via gnuplot.

    Here is some example i did:

    $ gnuplot < config.gp

    My config.gp

    set title "Test"
    set xrange["13.11.2014_07:00":"13.11.2014_23:00"]
    set output "Diagramm.png"
    set terminal png size 900,600
    set xdata time
    set timefmt "%s"
    set yrange [-20:40]
    set ylabel "Erste Skalierung"
    set y2label "Zweite Skalierung"
    set format x "%H:%M:%S"
    set xlabel "Time (HH:MM:SS)
    set grid
    set xtics
    set ytics
    set y2tics 25
    set y2range [0:100]
    set grid
    set datafile separator "|"

    plot '<sqlite3 test.db "select date || ''_'' || value0, value1, value2, value3 from werte"' using 1:4 title 'Wert0' with lines axes x1y2, \
    '' using 1:3 title 'Wert1' with lines axes x1y1, \
    '' using 1:2 title 'Wert2' with lines axes x1y1

    My test.db Database

    sqlite> SELECT * from values;
    ID value0 value1 date value 2 value3 value 4
    1|17.2|27.2|77.2|08:00:00|13.11.2014|2014-12-07 21:29:39
    2|-1.01|28.99|68.99|12:00:00|13.11.2014|2014-12-07 23:29:16
    3|20.26|30.26|75.26|14:00:00|13.11.2014|2014-12-07 23:29:26
    4|6.94|16.94|61.94|16:00:00|13.11.2014|2014-11-13 23:29:36
    5|7,56|18,66|65,56|18:00:00|13.11.2014|2014-11-13 23:50:00
    6|7,65|22,56|54,89|20:00:00|13.11.2014|2014-11-13 20:00:00
    7|12,56|33,58|54,96|22:00:00|13.11.2014|2014-11-13 22:00:00

    But all i get is an empty Diagramm.png with no lines.
    Does anyone have an idea?

    Best regards :-)

     
    • Edoardo Pasca

      Edoardo Pasca - 2014-12-16

      In the select statement you have some double quotes that I believe should
      not be there. And why don't you do the select as in the example you show?

      Edo

      e-mail sent with my mobile: excuses for typos and conciseness.
      On 16 Dec 2014 20:45, "jolle-pe" jolle-pe@users.sf.net wrote:

      Hello everybody,

      i try to plot some data from a sqlite3 database via gnuplot.

      Here is some example i did:

      $ gnuplot < config.gp

      My config.gp

      set title "Test"
      set xrange["13.11.2014_07:00":"13.11.2014_23:00"]
      set output "Diagramm.png"
      set terminal png size 900,600
      set xdata time
      set timefmt "%s"
      set yrange [-20:40]
      set ylabel "Erste Skalierung"
      set y2label "Zweite Skalierung"
      set format x "%H:%M:%S"
      set xlabel "Time (HH:MM:SS)
      set grid
      set xtics
      set ytics
      set y2tics 25
      set y2range [0:100]
      set grid
      set datafile separator "|"

      plot '<sqlite3 test.db "select date || ''_'' || value0, value1, value2,
      value3 from werte"' using 1:4 title 'Wert0' with lines axes x1y2, \ ''
      using 1:3 title 'Wert1' with lines axes x1y1, \ '' using 1:2 title 'Wert2'
      with lines axes x1y1

      My test.db Database

      sqlite> SELECT * from values;
      ID value0 value1 date value 2 value3 value 4
      1|17.2|27.2|77.2|08:00:00|13.11.2014|2014-12-07 21:29:39
      2|-1.01|28.99|68.99|12:00:00|13.11.2014|2014-12-07 23:29:16
      3|20.26|30.26|75.26|14:00:00|13.11.2014|2014-12-07 23:29:26
      4|6.94|16.94|61.94|16:00:00|13.11.2014|2014-11-13 23:29:36
      5|7,56|18,66|65,56|18:00:00|13.11.2014|2014-11-13 23:50:00
      6|7,65|22,56|54,89|20:00:00|13.11.2014|2014-11-13 20:00:00
      7|12,56|33,58|54,96|22:00:00|13.11.2014|2014-11-13 22:00:00

      But all i get is an empty Diagramm.png with no lines.
      Does anyone have an idea?

      Best regards :-)

      Gnuplot with Sqlite3 - no diagram lines plotted
      https://sourceforge.net/p/gnuplot/discussion/5925/thread/5298ede4/?limit=25#bc9c


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/gnuplot/discussion/5925/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

Log in to post a comment.