gnuplot-iostream
gnuplot-iostream copied to clipboard
Cannot flush output to file without destructing the Gnuplot instance
Apparently, none of gp << "set output";
, gp << std::flush;
, gp.do_flush()
can do proper flushing of output svg file, if it's done without destructing the gp
instance. I keep getting an empty output file. I guess, the library does not offer any explicit flushing API. Is there any workaround?
Thanks!
I don't know. gp.do_flush()
sends std::flush
to boost::iostreams::stream
and then calls fflush
on the underlying file handle. If data is not getting through, it's probably held up in boost::iostreams. You can check whether boost has any extra flush functions. Make sure you're putting a newline at the end of each gnuplot command.