title: Octave plot from Qt C++ application
body: <p>I have a QT C++ application that runs the Octave program using QProcess. I am able to communicate with it by reading the standard output/error and writing to it's standard input using write method (for example: octave->write("5 + 5\n");). </p>
  
  <p>As I told you I get response from octave (from the above example I get "ans = 10"). </p>
  
  <p>However, when the command I write to Octave standard input has a "plot" (for example, a simple plot([1 2 3 4 5]);), the actual graphic is never shown. I know Octave runs gnuplot, I have it installed, and gnuplot_x11 too. I even change the gnuplot binary path in my Octave process by executing gnuplot_binary("/usr/bin/gnuplot"); from MY APPLICATION. I know it runs good because if I retrieve the new value I get it right. But I don't know why Octave doesn't show the graphic.</p>
  
  <p>Here I start octave:</p>
  
  <pre><code>QStringList arguments;
  arguments &lt;&lt; "--persist";
  octave-&gt;setProcessChannelMode(QProcess::MergedChannels);
  octave-&gt;start("/usr/bin/octave", arguments);
  </code></pre>
  
  <p>Here I write commands to octave process:</p>
  
  <pre><code>if (octave-&gt;state() == QProcess::Running) {
      QString command = widget.txtInput-&gt;toPlainText();
      if (command.isEmpty()) {
          return;
      }
      command += "\n";
      octave-&gt;write(command.toAscii());
  }
  </code></pre>
  
  <p>With this I print the octave response to a text edit:</p>
  
  <pre><code>widget.txtOutput-&gt;append(octave-&gt;readAll() + "\n");
  </code></pre>
  
  <p>And finally, I use this when the octave process starts:</p>
  
  <pre><code>QString gnuplot_path(tr("\"/usr/bin/gnuplot\""));
  QString gnuplot_cmd(tr("gnuplot_binary(%1)\n").arg(gnuplot_path));
  octave-&gt;write(gnuplot_cmd.toAscii());
  </code></pre>
  
  <p>I will appreciate any help you could give me.</p>
  
  <p>Thanks in advance.</p>