im trying to open gnuplot from within c# and get it to save a png of a chart. There are 2 issues im having
1) both a black commandline box for gnuplot and the actual plot appear. I would like both of these to not appear.
2) After setting the terminal to png and plotting sin(x) it doesnt actually save the file. These same commands work within gnuplot though.
Any tips would be appreciated
Thanks
private void button1_Click(object sender, EventArgs e)
{
string Pgm = @"C:\Program Files\gnuplot\bin\gnuplot.exe";
Process extPro = new Process();
extPro.StartInfo.FileName = Pgm;
extPro.StartInfo.UseShellExecute = false;
extPro.StartInfo.RedirectStandardInput = true;
extPro.Start();
StreamWriter gnupStWr = extPro.StandardInput;
gnupStWr.WriteLine("Set terminal png");
gnupStWr.WriteLine(@"set output 'c:\Users\FrazMan\Desktop\sinxplot2.png'");
gnupStWr.WriteLine("plot sin(x)");
gnupStWr.WriteLine("set terminal wxt enhanced");
gnupStWr.WriteLine("set output");
gnupStWr.Flush();
}