comparison src/graphics.cc @ 7680:a0ec02774303

Use popen2 for communication with gnuplot
author David Bateman <dbateman@free.fr>
date Wed, 02 Apr 2008 13:29:19 -0400
parents d219e712c20e
children cb4838d70ab2
comparison
equal deleted inserted replaced
7679:3c16e2414564 7680:a0ec02774303
1289 void close_figure (const octave_value& pstream) const 1289 void close_figure (const octave_value& pstream) const
1290 { 1290 {
1291 if (! pstream.is_empty()) 1291 if (! pstream.is_empty())
1292 { 1292 {
1293 octave_value_list args; 1293 octave_value_list args;
1294 args(1) = "\nquit;\n"; 1294 Matrix fids = pstream.matrix_value ();
1295 args(0) = pstream; 1295
1296 feval ("fputs", args); 1296 if (! error_state)
1297 args.resize (1); 1297 {
1298 feval ("fflush", args); 1298 args(1) = "\nquit;\n";
1299 feval ("pclose", args); 1299 args(0) = octave_value (fids (0));
1300 feval ("fputs", args);
1301 args.resize (1);
1302 feval ("fflush", args);
1303 feval ("pclose", args);
1304 if (fids.numel () > 1)
1305 {
1306 args(0) = octave_value (fids (1));
1307 feval ("pclose", args);
1308 }
1309 }
1300 } 1310 }
1301 } 1311 }
1302 1312
1303 void redraw_figure (const graphics_handle& fh) const 1313 void redraw_figure (const graphics_handle& fh) const
1304 { 1314 {