Subject: | _draw_scale carps error when min == max |
In Glyph::xyplot, when the wig is very flat, for example with a smoothed
or filtered output, min == max and an ugly error message is produced at
the end of _draw_scale() instead of an empty plot.
Something like the following removes the error, but produced an
unfortunate looking plot:
Replace:
while ($height/(($max-$min)/$interval) < 2) { $interval *= 10 }
my $y_scale = $height/(($max-$min)/$interval);
With:
my $y_scale = $height*$interval; # probably a better choice than this
if ($max-$min != 0) {
while ($height/(($max-$min)/$interval) < 2) { $interval *= 10 }
$y_scale = $height/(($max-$min)/$interval);
}