Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use PDL; use PDL::Graphics2D; #imports imag2d() and twiddle() #use PDL::Graphics::PGPLOT::Window; my $winopt = {Device => '/GW', WindowWidth => 7, Aspect => 1}; my $w = PDL::Graphics2D->new($winopt); $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); $w = imag2d($a);
on the other hand the site http://cpan.uwinnipeg.ca/PPMPackages/10xx/contains opengl v 0.62 and PDL 2.4.7 while here http://www.perlmonks.org/?node=PDL-2.4.7+released syphilis said that it requires v. 0.63 . so i have downloaded it from http://www.bribes.org/perl/ppmdir.htmluse PDL; use PDL::Graphics::PGPLOT; #my $win1 = dev('/GW', {Aspect => 1, WindowWidth => 7}); $x = xlinvals(zeroes(100,100), -5, 5); $y = ylinvals(zeroes(100,100), -5, 5); $z = sin($x*$y/2); imag $z; hold; #Show the partial derivatives wrt. x & y as vectors $xcomp = $x*cos($x*$y/2)/2; $ycomp = $y*cos($x*$y/2)/2; #We want to show only every sixth vector for clarity $s = '0:-1:10,0:-1:10'; #Finally we need to map the final 10x10 array to the 100x100 image $tr = pdl(0,10,0,0,0,10); vect $xcomp->slice($s), $ycomp->slice($s), {Transform=>$tr};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: PDL questions
by moritz (Cardinal) on Sep 26, 2010 at 12:05 UTC | |
|
Re: PDL questions
by zentara (Cardinal) on Sep 26, 2010 at 17:09 UTC | |
|
Re: PDL questions
by syphilis (Archbishop) on Sep 27, 2010 at 07:32 UTC | |
|
Re: PDL questions
by syphilis (Archbishop) on Sep 27, 2010 at 08:36 UTC | |
by Anonymous Monk on Sep 27, 2010 at 10:59 UTC | |
by Anonymous Monk on Sep 27, 2010 at 13:49 UTC | |
by Corion (Patriarch) on Sep 27, 2010 at 14:14 UTC | |
by BrowserUk (Patriarch) on Sep 27, 2010 at 14:44 UTC | |
by Anonymous Monk on Sep 27, 2010 at 21:07 UTC | |
by Anonymous Monk on Sep 27, 2010 at 17:36 UTC | |
by Corion (Patriarch) on Sep 27, 2010 at 17:46 UTC |