4 use Tk
::LineGraphDataset
;
5 use Math
::GSL
::SF qw
/:all/;
9 my $window = MainWindow
->new( -title
=> 'Math::GSL Plot', );
10 my @popo = ("gsl_sf_bessel_J0", "gsl_sf_bessel_J1", "gsl_sf_bessel_Y0", "gsl_sf_bessel_Y1");
18 $del->configure( -state => "normal" );
21 $del = $window->Button(
22 -text
=> "Remove " . $popo[$n],
25 delete_set
($popo[$n]);
26 $del->configure( -state => "disabled" );
32 $window->Button( -text
=> "test", -command
=> [ \
®ion
, "test", $window ] )
37 if ($graph) { $graph->packForget(); }
39 my @region = map { $_ / 10 } ( -400 .. -1, 0, 1 .. 400 );
40 my @region2 = map { $_ / 10 } ( 1 .. 400 );
42 "gsl_sf_bessel_J0" => \
&sf_bessel_J0
,
43 "gsl_sf_bessel_J1" => \
&sf_bessel_J1
,
44 "gsl_sf_bessel_Y0" => \
&sf_bessel_Y0
,
45 "gsl_sf_bessel_Y1" => \
&sf_bessel_Y1
,
50 if ( $name =~ /(Y1|Y0)$/ ) {
51 @data1 = map { $functions{$name}->($_) } (@region2);
54 @data1 = map { $functions{$name}->($_) } (@region);
57 my $dataset1 = LineGraphDataset
->new(
59 -plottitle
=> [$name],
66 $sets{$name} = $dataset1;
68 $graph = $window->PlotDataset(
72 )->pack( -fill
=> 'both', -expand
=> 1 );
74 my @datasets = values %sets;
75 $graph->addDatasets(@datasets);
86 return gsl_sf_bessel_J0
( $_[0] );
90 return gsl_sf_bessel_J1
( $_[0] );
94 return gsl_sf_bessel_Y0
( $_[0] );
98 return gsl_sf_bessel_Y1
( $_[0] );