title: sh: gnuplot: command not found in Xcode
body: <p>Trying to open a pipe to Gnuplot in a simple C program, with</p>
  
  <pre><code>FILE *pipe=popen("gnuplot - persist", "w");
  </code></pre>
  
  <p>receiving the above error. I have installed Gnuplot using Macports and the gnuplot command works straight off using the bash terminal, but I cannot access it via the code above (sh).</p>
  
  <p>I have tried adding a .MacOSX with an environment.plist file (a suggestion I found online) but I cannot seems to get anything to work (using the explicit location of Gnuplot in the code doesn't seem to work for me either). Sorry if this is an obvious problem, I am very new to programming and I just want to plot some graphs! Thanks</p>