Hi Marek: I think no one has tried this before. The current version of PDL::Graphics::PLplot just increments the plstream number used each time 'new' is called. Once you get to 100 in the same program, it fails due to the plplot limitation on stream numbers.
I just made an updated version of PDL::Graphics::PLplot which manages a pool of PLstream numbers (0..99) and puts old numbers back into the pool when 'close' is called. I've just uploaded this to CPAN: PDL-Graphics-PLplot-0.51.tar.gz Regards, Doug Hunt dh...@ucar.edu Software Engineer UCAR - COSMIC, Tel. (303) 497-2611 On Mon, 13 Jul 2009, Marek Gierlinski wrote: > Hi, > > I have encountered a problem with PDL::Graphics::PLplot and wonder if > you could help me solving it. A little code illustrating the problem > is attached at the end of this e-mail. What I'm trying to do is to > create a few hundred GIF files with graphs. However, when I open and > close 100 files, PLplot starts complaining: > > plsstrm: Illegal stream number 100, must be in [0, 100] > > The test code shows that despite the complain the stream number is > reset to zero, and my files are created all right. I can't reset the > stream number manually: I tried using plsstrm, plend, plend1... > Nothing seems to be working, there must be an internal stream counter > in PLplot, which I cannot access. > > I'm not sure if this is a bug or intended feature. I'd expect > $win->close() to reset the stream number to 0 or 1, so my next new() > always works. I'd expect the stream number to increase only when I > open a few files (or graphic windows) simultaneously. > > I'd appreciate any help. > > Best regards, > Marek Gierlinski > University of Dundee, > Scotland, UK > > use PDL; > use PDL::Graphics::PLplot; > > for my $i (1 .. 120) > { > my $giffile = "test_${i}.gif"; > my $win = PDL::Graphics::PLplot->new(DEV => 'gif', FILE => $giffile, > PAGESIZE => [300, 300]); > print "Stream = ", plgstrm(), "\n"; > $win->xyplot(pdl(0,1), pdl(0,1)); > $win->close(); > unlink $giffile; > } > _______________________________________________ Perldl mailing list Perldl@jach.hawaii.edu http://mailman.jach.hawaii.edu/mailman/listinfo/perldl