|
From: Benjamin v. A. <ben...@gm...> - 2011-08-26 09:19:14
|
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
On Wed, Aug 24, 2011 at 10:45 PM, Mathias Anselmann <
mat...@li...> wrote:
> Hello,
> I have a problem with a program that runs just fine under linux but has
> some issues when compiling it with mingw under windows. Here is an exctract
> of the part which does not work as expected:
>
> //create pipe for accessing gnuplot
> FILE *pipe = popen("pgnuplot -persist","w");
>
> //adjust settings
> fprintf(pipe, "set palette gray negative\n");
>
> //plot
> fprintf(pipe, "plot 'fileX.txt' matrix with image\n");
> fflush(pipe);
>
> //close gnuplot pipe
> pclose(pipe);
>
> Under Linux I have the same code, except that I use "gnuplot" there instead
> of "pgnuplot". If I run this program under Windows I get two situations:
>
> a) I get the error:
>
> Timeout: gnuplot is not ready
>
> Then the "graphical" gnuplot main window (haven't seen this on Linux)
> opens, shows just "gnuplot>" an that's it.
>
> b) Sometimes it shows no error and the main window opens and I see that the
> commands which I want to execute via c++ are calles and I see the plot.
>
> Does anybody know a solution for this problem? (The best case woult be if I
> would just see the "plot window" like under linux, I don't want to see the
> "main window" (you get it if you call wgnuplot.exe under windows).
> Cheers,
> Mathias
>
>
> ------------------------------------------------------------------------------
> EMC VNX: the world's simplest storage, starting under $10K
> The only unified storage solution that offers unified management
> Up to 160% more powerful than alternatives and 25% more efficient.
> Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
> _______________________________________________
> gnuplot-info mailing list
> gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>
|