From: Torquil M. <to...@gm...> - 2008-01-21 23:52:11
|
Hello, sorry to ask so many questions... I am trying to get plplot to rewri= te=20 the plot to the same file several times (part of my quest to write to a pip= e=20 into ffmpeg). In between plots (plbop().....pleop()) I delete the file=20 (before I delete the file I send it into another ofstream that will pipe it= =20 into ffmpeg), and I expected plplot to recreate the file for the next plot = so=20 I can do it all over again. In the documentation is says that if using=20 plbop(): "For a file driver, the output file is opened if necessary." I'm now using the Debian Sid plplot, since I had segfault problems with the= =20 JPG-driver in the current SVN-version. I tried to reset the filename with=20 plsfnam() between the plots, using the same string as when running it befor= e=20 plinit(), but then I get a segfault. I have included a test program below. The part about piping the file into a= n=20 ofstream is not in this test program, but that has nothing to do with the=20 behaviour I'm discussing. I thought that a "1.jpg" would exist after the=20 program exits, but that is not the case. The file only exists until I delet= e=20 it in the program, it is not recreated at the next plbop(): Best regards, Torquil S=F8rensen #include <plplot/plplot.h> #include <cstdio> using namespace std; int main(int argc, char *argv[]) { double x[] =3D { 0.1, 0.5, 0.2, 0.4, 0.4 }; double y[] =3D { 0.5, 0.4, 0.4, 0.8, 0.9 }; plparseopts(&argc, argv, PL_PARSE_FULL); plsfnam("1.jpg"); plsdev("jpeg"); plinit(); plenv(0, 1, 0, 1, 1, -2); plbop(); plbox("bcinst", 0, 0, "bcinst", 0, 0); plline(5, x, y); pleop(); system("ls -l 1.jpg"); remove("1.jpg"); plbop(); plbox("bcinst", 0, 0, "bcinst", 0, 0); plline(5, x, y); pleop(); plend(); return(0); } |