> On Oct 16, 2012, at 4:17 PM, Kaj Wiik wrote: > > > Hi! > > > > First: amazing work, many thanks! > > > > However, while producing first PDL::Graphics::Gnuplot graphs for my > > student's presentation, I almost teared my hair off: everything > > worked fine until I tried to write PDF files... > > > > It seems that version 1.0 works OK but 1.1 produces truncated PDF > > files of size 4096 with pdfcairo terminal. > > > On Tue, 16 Oct 2012 16:29:26 -0600 > Craig DeForest <[email protected]> wrote: > > Hi, Kaj, > > I'm not sure how to fix this. The issue is that gnuplot itself > doesn't close out the PDF file until it encounters a reset or a > change of terminal. You can make it purge the file with ->reset() or > ->restart(), or by undef'ing the object. There's even a ->close(), > but that just issues a restart(). Some of the other terminals need > that too -- SVG, for example -- because the file format requires a > close block, and can also support multiple pages/plots. > > Please let me know if those tricks *don't* work for you -- I'm > putting together 1.2 now with some Microsoft Windows fixes (thanks to > Sisypus and to Juergen), and I'd be glad to roll in whatever comes > out of this bug. If they do, then perhaps it just needs to be placed > in the documentation.
Craig, is there a reason P::G::G can't close out the hardcopy plot when it's done? Is it that it can't know that it's done until it's too late? You can close out at the end of plot() or you can catch the program exit in the destructor. I did encounter some corner cases previously where gnuplot would exit before being 100% done with writing the output. You may not be hitting these right now, but probably should handle them anyway. Look at the block at https://github.com/dkogan/feedgnuplot/blob/master/bin/feedgnuplot#L548 (this is a pipe plotter, not related to PDL). dima _______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
