|
From: Tatsuro M. <tma...@ya...> - 2008-03-19 11:48:16
|
Hello --- gnu...@t4... wrote: > > If I've understood correctly how pgnuplot.exe is supposed to work on Win32, > type "object map.gps" | pgnuplot.exe > should be essentially equivalent to starting wgnuplot.exe and saying > load "object map.gps" > > Is that right, or am I missing something here? It is not right. The above two cases are completely different one another. The pgnuplot recieves the streams from pipe and sends them to wgnuplot command line using win32 api function. For details, please read the source of pgnuplot. http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/src/win/pgnuplot.c?revision=1.15.2.1&view=markup The latter directly loads the commands or data from the file. The followings are the parts of my c program using pgnuplot before if((gp = _popen(PGNUPLOT_PATH, "w")) == NULL){ fprintf(stderr, "Error! I can't find %s.", PGNUPLOT_PATH); exit(EXIT_FAILURE); } : : while(fgets(buff,BSIZE,fp) != NULL){ fprintf(gp,"%s",buff);fflush(gp); } In using pgnuplot, using of fflush(gp); after sending one command line is desirble. Note The wgnuplot_pipes.exe is entirely different from the pgnuplot It allows that plot '< awk -f awkscript.awk' on the wgnuplot. Regards Tatsuro > The problem I see, both on 4.2 and 4.3, is that commands in object map.gps > are seemingly lost or overlooked. This leads to syntax errors, and all > sorts of other problems. Normally, pgnuplot.exe closes the wgnuplot.exe > input window when it reaches EOF. However, in the above scenario with > "type," the GnuPlot application window remains open, displaying the > history of botched commands piped in from pgnuplot. That's how I know > some commands (or parts of commands) are being skipped. It's almost as > if the pipe needs flow control but doesn't have it... losing bytes that > fall off the end of the "buffer" when it gets full. > > If I avoid type and put a "sleep 1" between every line I copy into the > pipe, the script works fine, except that it takes an eternity to run > anything nontrivial. If I open GnuPlot and say "load 'object map.gps'" > it works fine. If I run wgnuplot.exe "/path/to/object map.gps", that also > works fine. The apparent flow control problem is limited to pgnuplot.exe. > (I've had no luck at all with wgnuplot_pipes.exe.) > > I've seen this behavior on multiple Windows XP installs, at least one > Vista, and Server 2003, so it's not particular to one computer, OS, or > GnuPlot version. Anyone else run into this problem? Anyone have an idea > what's going on? Ideas for a work-around? > > If you want to try it yourself, I've attached an example *.gps that > generates the errors from above. [If you try to run it on 4.3, you'll > have to substitute c:/windows/fonts/verdana.ttf for Verdana.ttf as > 4.3 seems to have lost the ability to find fonts without a full path to > the file.] > > This all started because I'd really like to do "perl.exe script.pl | > pgnuplot.exe" but that has the same issue. > > Tait > > > # comment > # comment > # comment > cd 'C:/temp' > reset > set terminal png transparent nointerlace truecolor font 'verdana.TTF,10' size 800,650 nocrop > enhanced xffffff > set output 'Object Map.png' > set title 'Object Map 317366435' font 'Verdana.ttf,14' tc rgbcolor '#A80868' noenhanced > set xtics 4 > set ytics 4 > set grid front > set cbrange [0.0:1.0] > set xrange [4:45] > set yrange [6:30] > plot '-' with rgbimage notitle > 0 0 1 1 1 > 0 1 1 1 1 > 0 2 1 1 1 > 0 3 1 1 1 > 0 4 1 1 1 > 0 5 1 1 1 > 0 6 1 1 1 > 0 7 1 1 1 > 0 8 1 1 1 > 0 9 1 1 1 > 0 10 1 1 1 > 0 11 1 1 1 > 0 12 1 1 1 > 0 13 1 1 1 > 0 14 1 1 1 > 0 15 1 1 1 > 0 16 1 1 1 > 0 17 1 1 1 > 0 18 1 1 1 > 0 19 1 1 1 > 0 20 1 1 1 > 0 21 1 1 1 > 0 22 1 1 1 > 0 23 1 1 1 > 0 24 1 1 1 > 0 25 1 1 1 > 0 26 1 1 1 > 0 27 1 1 1 > 0 28 1 1 1 > 0 29 1 1 1 > 1 0 1 1 1 > 1 1 1 1 1 > 1 2 1 1 1 > 1 3 1 1 1 > 1 4 1 1 1 > 1 5 1 1 1 > 1 6 1 1 1 > 1 7 1 1 1 > 1 8 1 1 1 > 1 9 1 1 1 > 1 10 1 1 1 > 1 11 1 1 1 > 1 12 1 1 1 > 1 13 1 1 1 > 1 14 1 1 1 > 1 15 1 1 1 > 1 16 1 1 1 > 1 17 1 1 1 > 1 18 1 1 1 > 1 19 1 1 1 > 1 20 1 1 1 > 1 21 1 1 1 > 1 22 1 1 1 > 1 23 1 1 1 > 1 24 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1 > 4 20 1 1 1 > 4 21 1 1 1 > 4 22 1 1 1 > 4 23 1 1 1 > 4 24 1 1 1 > 4 25 1 1 1 > 4 26 1 1 1 > 4 27 1 1 1 > 4 28 1 1 1 > 4 29 1 1 1 > 5 0 1 1 1 > 5 1 1 1 1 > 5 2 1 1 1 > 5 3 1 1 1 > 5 4 1 1 1 > 5 5 1 1 1 > 5 6 1 1 1 > 5 7 1 1 1 > 5 8 1 1 1 > 5 9 1 1 1 > 5 10 1 1 1 > 5 11 1 1 1 > 5 12 1 1 1 > 5 13 1 1 1 > 5 14 1 1 1 > 5 15 1 1 1 > 5 16 1 1 1 > 5 17 0.84 0.36 0.36 > 5 18 1 1 1 > 5 19 1 1 1 > 5 20 1 1 1 > 5 21 1 1 1 > 5 22 1 1 1 > 5 23 1 1 1 > 5 24 1 1 1 > 5 25 1 1 1 > 5 26 1 1 1 > 5 27 1 1 1 > 5 28 1 1 1 > 5 29 1 1 1 > 6 0 1 1 1 > 6 1 1 1 1 > 6 2 1 1 1 > 6 3 1 1 1 > 6 4 1 1 1 > === 以下のメッセージは省略されました ===> ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/> _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-beta > -------------------------------------- Easy + Joy + Powerful = Yahoo! Bookmarks x Toolbar http://pr.mail.yahoo.co.jp/toolbar/ |