Skip to content

Commit

Permalink
simplify dim-number check
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed May 4, 2024
1 parent 5f5b290 commit 85b7214
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/PDL/Graphics/Simple.pm
Original file line number Diff line number Diff line change
Expand Up @@ -932,10 +932,9 @@ sub _translate_plot {
unless ( ($dims==1) | ($dims==$dmax) )->all;

# Check that the number of dimensions is correct...
if($dims->dim(0) != $pt->{ndims}->[0] and
((!defined($pt->{ndims}->[1])) or ($dims->dim(0) != $pt->{ndims}->[1]))) {
barf "Data dimension (".$dims->dim(0)."-D PDLs) is not correct for plot type $ptn";
}
barf "Data dimension (".$dims->dim(0)."-D PDLs) is not correct for plot type $ptn (all dims=$dims)"
if $dims->dim(0) != $pt->{ndims}[0] and
(!defined($pt->{ndims}[1]) or $dims->dim(0) != $pt->{ndims}[1]);

if (@args > 1) {
# Accumulate x and y ranges...
Expand Down

0 comments on commit 85b7214

Please sign in to comment.