Skip to content

Commit

Permalink
update re Fortran/PGPLOT
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Jan 27, 2025
1 parent af0aeef commit ba3fa7e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ Of course, they also work in perl scripts.

- PDL

Perl Data Language. Preferably installed with a Fortran compiler. A
few methods (logistic regression and all plotting methods) will only
work with a Fortran compiler and some methods (ordinary least squares
regression and pca) work much faster with a Fortran compiler.
Perl Data Language.

The required PDL version is 2.057.

Expand All @@ -35,11 +32,10 @@ Of course, they also work in perl scripts.
- PGPLOT (Optional)

PDL-Stats currently uses PGPLOT for plotting. There are
three pgplot/PGPLOT modules, which cause much confusion upon
two pgplot/PGPLOT modules, which cause much confusion upon
installation. First there is the pgplot Fortran library. Then there is
the perl PGPLOT module, which is the perl interface to pgplot. Finally
there is PDL::Graphics::PGPLOT, which depends on pgplot and PGPLOT,
that PDL-Stats uses for plotting.
the perl PGPLOT module, which is the perl interface to pgplot, including
PDL::Graphics::PGPLOT, that PDL-Stats uses for plotting.

## INSTALLATION

Expand Down
12 changes: 4 additions & 8 deletions lib/PDL/Stats/Kmeans.pd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The terms FUNCTIONS and METHODS are arbitrarily used to refer to methods that ar
=head1 SYNOPSIS

Implement a basic k-means procedure,

use PDL::LiteF;
use PDL::NiceSlice;
use PDL::Stats;
Expand Down Expand Up @@ -55,15 +55,11 @@ or, use the B<kmeans> function provided here,

plot the clusters if there are only 2 vars in $data,

use PDL::Graphics::PGPLOT::Window;
use PDL::Graphics::Simple;

my ($win, $c);
$win = pgwin 'xs';
$win->env($data( ,0)->minmax, $data( ,1)->minmax);

$win->points( $data->dice_axis(0,which($k{cluster}->(,$_)))->dog,
{COLOR=>++$c} )
for (0 .. $k{cluster}->dim(1)-1);
$win = pgswin();
$win->plot(map +(with=>'points', $data->dice_axis(0,which($k{cluster}->(,$_)))->dog), 0 .. $k{cluster}->dim(1)-1);

=cut

Expand Down

0 comments on commit ba3fa7e

Please sign in to comment.