|
From: Tatsuro M. <tma...@ya...> - 2008-03-24 10:06:12
|
Hello First I would like to introduce myself. I'm not a member of the deveploment team and only one of the user of gnuplot. I'm a maintainer of testing realese of the octave on the cygwin and the mingw. Octave uses gnuplot as a plotting enigine, so I have been stated my opinion here. Apart from the octave, I am a daily user of gnuplot (about twenty years.). Sometimes I reply the question on the ML as a long term user. > I don't have much experience with interprocess communication, so I don't > know how these kinds of things are usually handled, but it seems like a > problem that must have been solved many times over. It is known that data from pipe like plot '-' 1, 1 : : e is too fast to plot for pgnuplot. This phenomenon is a main complaint of octave for windows team. Michael Goffioul, who is a powerful maintainer of octave built by Microsoft C++, has build a special version of gnuplot for octave. That is console mode gnuplot on windows. If you would like to see it, please visit the my web page http://www.geocities.jp/tmoctwin/ and download the octave by the Michael. And please also see ReadmeMingwOct3.0.xx.txt in Octave 3.0.0 mingw testing binaries. Please read section 2.1.1 and you can get specially prepared console mode gnuplot 4.2.2. Another solution is to use cygwin gnuplot. For my web page, I prepare the smallest set the cygwin gnuplot 4.3 (cvs release). You can use it if the X server (Xming) will be installed. However, if plotting data given from the file pgnuplot has no problem for use. At the end of mail I wrote my old test C++ program for pgnuplot. > Tatsuro MATSUOKA <tmacchant3_yahoo.co.jp> said (on 2008/03/19): > > The wgnuplot_pipes.exe is entirely different from the pgnuplot > > It allows that > > plot '< awk -f awkscript.awk' > > Is there a reason why the wgnuplot_pipes behavior is not simply the > default in wgnuplot.exe? I do know the reason because I am a mere user. Perhaps other people reply to this. Regards Tatsuro *************** #include <iostream.h> #include <stdio.h> #include <stdlib.h> #define GNUPLOT_PATH "pgnuplot" void wait(int); FILE *fopenck(char *, char *); int main() { FILE *gp, *fp; int i,j; double x; if((gp = _popen(GNUPLOT_PATH, "w")) == NULL){ fprintf(stderr, "Oops, I can't find %s.", GNUPLOT_PATH); exit(EXIT_FAILURE); } fp=fopenck("temp.txt", "w"); fclose(fp); fprintf(gp, "set xrange [0:300]\n");fflush(gp); fprintf(gp, "set yrange [0:90000]\n");fflush(gp); fprintf(gp, "plot '-' \n 0 0\n e\n");fflush(gp); wait(1000); for (i=0;i<300;i++) { fp=fopenck("temp.txt", "a"); fprintf(fp, "%d %d \n",i, i*i);fflush(fp);fclose(fp); fprintf(gp, "plot 'temp.txt'\n");fflush(gp); wait(1); } //fprintf(gp, "clear\n"); fflush(gp); fprintf(gp, "pause -1 \"Press OK\"\n"); fflush(gp); /* Don't forget to flush the buffer. */ fprintf(gp, "set xrange [0:2*pi]\n");fflush(gp); fprintf(gp, "set yrange [-1:1]\n");fflush(gp); fprintf(gp, "plot sin(x)\n"); fflush(gp); /* Don't forget to flush the buffer. */ fprintf(gp, "pause -1 \"Press OK to end\"\n"); fflush(gp); /* Don't forget to flush the buffer. */ // getchar(); _pclose(gp); exit(EXIT_SUCCESS); } FILE *fopenck(char *fn, char *mode) { FILE *fp; if((fp = fopen(fn, mode)) == NULL){ fprintf(stderr, "Oops, I can't find %s.", "temp.txt"); exit(EXIT_FAILURE); } return fp; } void wait(int times) { int i; static int counter=0; for(i=0;i<times;i++) printf("Wait ! : %d\r",counter++); } -------------------------------------- Easy + Joy + Powerful = Yahoo! Bookmarks x Toolbar http://pr.mail.yahoo.co.jp/toolbar/ |