title: How do I run Gnuplot Scripts from a Java environment?
body: <p>All of the information I'm finding about using JavaPlot is about how to create plots and run them from a Java code-level. This is fine, but I already have some script files used that do what I want them to outside of Jave when a user executes them. Right now, I can open Gnuplot, and type the commands </p>
  
  <pre><code>gnuplot&gt; load "script.plt"
  </code></pre>
  
  <p>And it will output me a nice .png graphic of the plot I have. In the script, one of the lines called is</p>
  
  <pre><code>plot "graphData.dat" title "Line Title"
  </code></pre>
  
  <p>The file 'graphData.dat' stores the co-ordinate information needed to plot my graph.</p>
  
  <p>This works fine when the user double-clicks the 'script.plt' file in its folder (I'm running in a Windows environment). This is pretty flawless (minus the fact that the gnuplot process doesn't end properly, which is not what I'm asking about but if it rings any bells, I'd love to hear how to fix that, too). </p>
  
  <p>The problem I'm facing is that I need to be able to run the script through gnuplot <em>through a java environment</em>. My program needs to automatically export a .png graphic using gnuplot. I've done some looking around, and JavaPlot seems to be the library of choice for Java Support in Gnuplot, but I can't get it to do what I want: simply running an instance of gnuplot that calls the aforementioned load command.</p>
  
  <p>Any help or advice I can get would be appreciated, I've tried forsaking the script file, I've tried to dynamically call the load command (but not from the correct place, apparently), and I've tried plotting the .dat file directly, which it <em>really</em> doesn't like. As long as I can get that script running, I'm set.</p>