diff --git a/CHANGES b/CHANGES index c16ab01..101ddc7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +- fix {colorbox=>1} (#100) + 2.025 2024-04-20 - Split version checking from `use Alien::Gnuplot` line for easier downstream packaging. Fixes #98. diff --git a/lib/PDL/Graphics/Gnuplot.pm b/lib/PDL/Graphics/Gnuplot.pm index 26e148c..f47a78f 100644 --- a/lib/PDL/Graphics/Gnuplot.pm +++ b/lib/PDL/Graphics/Gnuplot.pm @@ -5211,7 +5211,7 @@ our $cOptionsTable = { ], 'using' => ['l','cl',undef,6], # using clauses in order (straight passthrough) # legend is a special case -- it gets parsed as a list but emitted as a quoted scalar. - 'legend' => ['l', sub { if(defined($_[1]) and defined $_[1][0]) {return "title \"$_[1][0]\"";} else {return "notitle"}}, + 'legend' => ['ln', sub { if(defined($_[1]) and defined $_[1][0]) {return "title \"$_[1][0]\"";} else {return "notitle"}}, undef, 7], 'axes' => [['(x[12])(y[12])'],'cs',undef,8], 'smooth' => ['s','cs',undef,8.1], @@ -5568,10 +5568,10 @@ $_pOHInputs = { ## one-line list (can also be boolean) l => sub { return $_[1] if !defined $_[1] or !length $_[1] or ref $_[1] eq 'ARRAY'; - return [$_[1]] if( (!ref($_[1])) && "$_[1]" =~ m/^\s*\-?\d+\s*$/); # nonzero integers yield true - # Not setting a boolean value - it's a list (or a trivial list). - # anything that's not an array ref (and not a number) gets put in the array - return [$_[1]]; + return $_[1] if !ref($_[1]) && "$_[1]" =~ m/^\s*\-?\d+\s*$/; # nonzero integers yield true + # Not setting a boolean value - it's a list (or a trivial list). + # anything that's not an array ref (and not a number) gets put in the array + return [$_[1]]; }, ## one-line list (no booleanity: scalars always get copied to the list) diff --git a/t/plot.t b/t/plot.t index 2baeaa3..66c3e30 100644 --- a/t/plot.t +++ b/t/plot.t @@ -145,6 +145,13 @@ unlink($testoutput) or warn "\$!: $! for '$testoutput'"; like $text, qr/unset multiplot/, 'end_multi_generate'; } +{ + my $w = gpwin('dumb',size=>[79,24,'ch'], output=>$testoutput); + my $r9 = rvals(9,9); + eval {$w->plot({colorbox => 1},{with => 'image'},$r9->xvals,$r9->yvals,$r9)}; + is($@, '', "colorbox succeeded"); +} + if ($PDL::Graphics::Gnuplot::gp_version >= 4.7) { # only 4.7+ $w = gpwin('dumb',size=>[79,24,'ch'], output=>$testoutput); $w->multiplot(layout=>[1,2]);