Skip to content

Commit

Permalink
Gnuplot unknown plot type give correct error
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Apr 25, 2024
1 parent fa71663 commit 3c430e4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/PDL/Graphics/Simple/Gnuplot.pm
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,8 @@ sub plot {
my @arglist = ($po);

for my $block(@_) {
my $ct = $curve_types->{ $block->[0]->{with} };

unless(defined($ct)) {
die "PDL::Graphics::Simple::Gnuplot: undefined curve type $ct";
}
die "PDL::Graphics::Simple::Gnuplot: undefined curve type $block->[0]{with}"
unless my $ct = $curve_types->{ $block->[0]{with} };
if(ref($ct) eq 'CODE') {
$block = &$ct($me, $po, @$block);
} else {
Expand Down

0 comments on commit 3c430e4

Please sign in to comment.