Contours.pm (PDL-2.082) | : | Contours.pm (PDL-2.083) | ||
---|---|---|---|---|

skipping to change at line 17 | skipping to change at line 17 | |||

=for usage | =for usage | |||

# A simple contour plot in black and white | # A simple contour plot in black and white | |||

use PDL::Graphics::TriD; | use PDL::Graphics::TriD; | |||

use PDL::Graphics::TriD::Contours; | use PDL::Graphics::TriD::Contours; | |||

$size = 25; | $size = 25; | |||

$x = (xvals zeroes $size,$size) / $size; | $x = (xvals zeroes $size,$size) / $size; | |||

$y = (yvals zeroes $size,$size) / $size; | $y = (yvals zeroes $size,$size) / $size; | |||

$z = (sin($x*6.3) * sin($y*6.3)) ** 3; | $z = (sin($x*6.3) * sin($y*6.3)) ** 3; | |||

$data=new PDL::Graphics::TriD::Contours($z, | $data=PDL::Graphics::TriD::Contours->new($z, | |||

[$z->xvals/$size,$z->yvals/$size,0]); | [$z->xvals/$size,$z->yvals/$size,0]); | |||

PDL::Graphics::TriD::graph_object($data) | PDL::Graphics::TriD::graph_object($data) | |||

=cut | =cut | |||

package PDL::Graphics::TriD::Contours; | package PDL::Graphics::TriD::Contours; | |||

use strict; | use strict; | |||

use warnings; | use warnings; | |||

use PDL; | use PDL; | |||

use PDL::Graphics::TriD; | use PDL::Graphics::TriD; | |||

skipping to change at line 45 | skipping to change at line 45 | |||

=head1 FUNCTIONS | =head1 FUNCTIONS | |||

=head2 new() | =head2 new() | |||

=for ref | =for ref | |||

Define a new contour plot for TriD. | Define a new contour plot for TriD. | |||

=for example | =for example | |||

$data=new PDL::Graphics::TriD::Contours($d,[$x,$y,$z],[$r,$g,$b],$options); | $data=PDL::Graphics::TriD::Contours->new($d,[$x,$y,$z],[$r,$g,$b],$options); | |||

where $d is a 2D pdl of data to be contoured. [$x,$y,$z] define a 3D | where $d is a 2D pdl of data to be contoured. [$x,$y,$z] define a 3D | |||

map of $d into the visualization space [$r,$g,$b] is an optional [3,1] | map of $d into the visualization space [$r,$g,$b] is an optional [3,1] | |||

ndarray specifying the contour color and $options is a hash reference to | ndarray specifying the contour color and $options is a hash reference to | |||

a list of options documented below. Contours can also be colored by | a list of options documented below. Contours can also be colored by | |||

value using the set_color_table function. | value using the set_color_table function. | |||

=for opt | =for opt | |||

ContourInt => 0.7 # explicitly set a contour interval | ContourInt => 0.7 # explicitly set a contour interval | |||

End of changes. 2 change blocks. | ||||

2 lines changed or deleted | | 2 lines changed or added |