Menu

plot data from different files in one diagram

Help
2017-04-12
2017-04-13
  • Martin Neumann

    Martin Neumann - 2017-04-12

    hallo together,

    I am a rookie with gnuplot but I am convinced of its benefits. I have a lot of data files and I want to plot it in one diagram. but I do know how. If I use something like that

    do for [i=1:8] {
    plot sprintf('01_S%02.0f_N.csv', i) using 34:8 title "el. Leistung" axes x1y1 with points pointtype 5 pointsize 0.5
    }

    I read the data but every loop creats allways a new diagram.

    I saw a funktion, how I can create one whole data file with paste but first it does not work and secound I think it is a poor solution.

    Do you have an idea?

     
    • Edoardo Pasca

      Edoardo Pasca - 2017-04-12

      You shouldn't use the command plot at every iteration.

      there should be only one plot so that will create one plot.

      I suggest you to be less lazy and write what you want without the for loop

      plot 'file1' u 1:2 t 'title1' w linespoints, \ 'file2' u 1:2 t 'title2' w linespoints \ ...

      Edo

      On Wed, Apr 12, 2017 at 2:10 PM, Martin Neumann <martinneumann3@users.sf.net

      wrote:

      hallo together,

      I am a rookie with gnuplot but I am convinced of its benefits. I have a
      lot of data files and I want to plot it in one diagram. but I do know how.
      If I use something like that

      do for [i=1:8] {
      plot sprintf('01_S%02.0f_N.csv', i) using 34:8 title "el. Leistung" axes
      x1y1 with points pointtype 5 pointsize 0.5
      }

      I read the data but every loop creats allways a new diagram.

      I saw a funktion, how I can create one whole data file with paste but
      first it does not work and secound I think it is a poor solution.

      Do you have an idea?

      plot data from different files in one diagram
      https://sourceforge.net/p/gnuplot/discussion/5925/thread/c7ebcb8b/?limit=25#2039


      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/

      --
      Edo
      I know you think you understand what you thought I said, but I'm not sure
      you realize that what you heard is not what I meant (prob. Alan Greenspan)
      :wq

       
    • Bastian Märkisch

      You should loop within the plot command in that case:

      plot for [i=1:8] sprintf('01_S%02.0f_N.csv', i) using 34:8 title "el. Leistung" axes x1y1 with points pointtype 5 pointsize 0.5
      

      Also see help plot for.

      If you want several plots on one "canvas" instead , see help multiplot.

       
  • Martin Neumann

    Martin Neumann - 2017-04-13

    it works!

    /wie kann ich mehre Dateien in ein Diangramm plotten

     
  • Martin Neumann

    Martin Neumann - 2017-04-13

    thx

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.