On 9/28/2010 4:36 AM, eros olmi wrote: > > i am a new user of pdl ,i have tried to run the color > code listed in http://search.cpan.org/~chm/PDL-2.4.7/Graphics/Graphics2D.pm > and i have posted recently a message to perlmonk, finally i > have found that i need the file imag2d.pdl, i can't find the > file in my perl folder nor in the PDL-2.4.7.tar.gz source, > but i found it in the PDL-2.4.6.tar.gz source, i have downloaded a newer > file from > > > http://sourceforge.net/tracker/?func=detail&atid=300612&aid=2925007&group_id=612 > > is it planned to include the file in a future package ?.
The imag2d routine is now part of PDL::Graphics2D. > this is my last successfull code to display the color code found in > Graphics2D.pm > its image like a redish dusk sky over a green ground (an ar! t painting) > > http://img46.imageshack.us/img46/7928/imag2d.png > > this is working well on ms windows if putting the file imag2d.pdl in the > same folder of the code > > use PDL; > use PGPLOT; > use PDL::Graphics2D; #imports imag2d() and twiddle() > use PDL::AutoLoader; > our @PDLLIB; > push @PDLLIB, '.'; > #my $winopt = {Device => '/GW', WindowWidth => 7, Aspect => 1}; > #my $w = PDL::Graphics2D->new('PGPLOT'); > $a = sequence(64,48,3); # make test RGB image > $a = $a->mv(2,0); # color must be dim(0) with size [0..4] > $a /= $a->max; # pixel values in [0.0,1.0] > $a = sin(10*$a); > imag2d($a); This is for PDL-2.4.6. With PDL-2.4.7, the corresponding code is (from pdldoc PDL::Graphics2D): use PDL::Graphics2d; # imports imag2d() and twiddle() $a = sequence(64,48,3); # make test RGB image $a = $a->mv(2,0); # color must be dim(0) with size [0..4] $a /= $a->max; # pixel values in [0.0,1.0] $a = sin(10*$a); $w1 = imag2d($a); # with parens... $w2 = imag2d $a->sqrt; # or without $w3 = imag2d $a**2; > on ms windows this code working well, on linux mint i get error : > Your vendor has not defined OpenGL macro GLUT_ACTION_ON_WINDOW_CLOSE, > used at (eval 36) line 415. what is this meaning . This means that the FreeGLUT library cannot be found. It sounds like you may have pieces of an earlier PDL-2.4.6 install mixed in with the PDL-2.4.7 one. A side effect of this can be mysterious failures of things that should work. You may need to remove the previous PDL install folders (named PDL in the directories with the perl libraries). Look under /usr/lib/perl5 to start. > on linux i have'nt plplot installed yet. > also in the synopsis of the PDL::Graphics2D there is: > $win = PDL::Graphics2D->new(<Interface>, <Options>); I don't know about this part of Graphics2D. > i have commented it above because if i uncomment it i will get two > windows the first for the plot and the second an empty window covering! > with persistence the plot window, so how to use exactly > $win = PDL::Graphics2D->new(<Interface>, <Options>); > to display the plot to the screen, > > at last thanks very much for the wonderfull PDL module, > especially the 3D features with PDL::Graphics::TriD > best wishes Thanks and good luck, Chris _______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
