@@ -2048,7 +2048,9 @@ Plots residuals against predicted values.
20482048
20492049Usage:
20502050
2051- $y->plot_residuals( $y_pred, { dev=>'/png' } );
2051+ use PDL::Graphics::Simple;
2052+ $w = pgswin();
2053+ $y->plot_residuals( $y_pred, { win=>$w } );
20522054
20532055=for options
20542056
@@ -2076,7 +2078,7 @@ sub PDL::plot_residuals {
20762078 );
20772079 if ($opt) { $opt{uc $_} = $opt->{$_} for keys %$opt; }
20782080 my $residuals = $y - $y_pred;
2079- my $win = $opt{WIN} || PDL::Graphics::Simple::pgswin(size=>[$ opt{SIZE}, $opt{ SIZE} ]);
2081+ my $win = $opt{WIN} || PDL::Graphics::Simple::pgswin(size=>[@ opt{qw( SIZE SIZE)}, 'px' ]);
20802082 $win->plot(
20812083 with=>'points', style=>$opt{COLOR}, $y_pred, $residuals,
20822084 with=>'lines', style=>$opt{COLOR}, pdl($y_pred->minmax), pdl(0,0), # 0-line
@@ -2130,7 +2132,7 @@ sub PDL::plot_scores {
21302132 # transformed normed values
21312133 my $scores = sumover($eigvec->slice(':',$i) * $z->transpose->dummy(1))->transpose;
21322134 $z = $z->slice(':',$i)->sever;
2133- my $win = $opt{WIN} || PDL::Graphics::Simple::pgswin(size=>[$ opt{SIZE}, $opt{ SIZE} ]);
2135+ my $win = $opt{WIN} || PDL::Graphics::Simple::pgswin(size=>[@ opt{qw( SIZE SIZE)}, 'px' ]);
21342136 $win->plot(
21352137 with=>'points', style=>$opt{COLOR}[0], ke=>'original', $z->slice(',(0)'), $z->slice(',(1)'),
21362138 with=>'points', style=>$opt{COLOR}[1], ke=>'transformed', $scores->slice(',(0)'), $scores->slice(',(1)'),
0 commit comments