title: gnuplot: multiplots using multiple lines in each plot and in-line data
body: <p>I am trying to call gnuplot from torch in order to plot several things. I am trying to use multiplots (like subplots in matlab), and at the same time plot different curves in the same plots. Furthermore, I'm defining the data in-line, i.e., avoiding writing the data in external files (plot '-').</p>
  
  <p>I've tried plotting several curves with '-' in several ways, with multiplot previous and next, with replot... but any combination messes up the layout in one way or another. Does anybody knows how to do this or can give some hints? </p>
  
  <p>Thanks!</p>
  
  <p><strong>Update</strong>: Added a small example. Blue and red lines should be plotted in the same plot (top one), while green one should be plotted alone in the bottom one. </p>
  
  <p>Example:</p>
  
  <pre><code>gnuplot.figure(1)
  gnuplot.raw('set terminal x11 0 position 1200,20 persist')
  gnuplot.raw('set multiplot layout 2,1')
  
  gnuplot.raw([[plot '-' lt rgb 'blue'
              0 0
              100 30
              e]])
  
  gnuplot.raw([[plot '-' lt rgb 'red'
              0 30
              100 60
              e]])
  
  gnuplot.raw([[plot '-' lt rgb 'green'
              0 60
              100 90
              e]])
  
  gnuplot.raw('unset multiplot')
  </code></pre>