|
From: Mathias A. <mat...@li...> - 2011-08-26 10:37:42
|
Hello Ben,
your hint was really valuable, I'm again a step further now, so I guess this is the c syntax that I need:
FILE *pipe = _popen("gnuplot --persist > NULL 2>&1","w");
with this option the output of gnuplot is not displayed on my standard output. Unfortunately "--persist" seems to be usesless (also tried "-p") on windows, as the plot window closes after the program closes - and that's what I don't want. A really weird problem, I didn't think that this story can be that tough, in fact I have chosen gnuplot for easy cross-platform plotting...
So has anybody got a clue for me here?
Cheers,
Mathias
On Fri, 26 Aug 2011 11:19:08 +0200
Benjamin von Ardenne <ben...@gm...> wrote:
> Hey Mathias,
>
> here is some code I use in lua to open gnuplot as a pipe:
>
>
> local gnu = io.popen(string.format("gnuplot -e \"load 'histogram.plt'\"
> 2>&1") ,"r")
> local res = gnu:read("*a")
> gnu:close()
>
> Altough it is a little bit differt to yours, try adding the "2>&1" to your
> command. It should reroute the standard output to the stderr stream. As you
> can see, you can still get the gnuplot output by reading from the stream.
>
> I hope that will help you.
>
> Cheers,
> Ben
|