Bug#359943: libchart-perl: integer_ticks_only doesn't honor max_y_ticks

Bill Allombert allomber at math.u-bordeaux.fr
Tue Apr 4 09:58:32 UTC 2006


On Sun, Apr 02, 2006 at 11:23:35PM +0300, Niko Tyni wrote:
> On Sun, Mar 26, 2006 at 08:40:06PM +0200, Bill Allombert wrote:
> 
> > You get 200 Y ticks (which are unreadable) disregarding the max_y_ticks of
> > 6. If you remove integer_ticks_only, you get just 3 ticks.
> 
> Hi,
> 
> the attached patch should fix this. I have forwarded it upstream as well,
> as CPAN #18502 ,<http://rt.cpan.org/Public/Bug/Display.html?id=18502>.
> 
> In the case of max_y_ticks, if the result would go over that, the tick
> interval is increased. This will override 'skip_int_ticks', if needed.

Maybe, make sure the tick interval is 10^n or 5*10^n for some n>=0
to follow the non-integer_ticks_only behaviour.

> In the case of min_y_ticks, if the result is below that, first the tick
> interval is decreased (overriding 'skip_int_ticks', if needed). If that
> doesn't help, the range of the scale is increased by either increasing
> the maximum value or decreasing the minimum value. If both are fixed,
> there's nothing to be done.
> 
> I'm going to wait a while to see what upstream thinks about this
> before including the patch in the Debian packaging. Please try the patch
> and tell me if it works for you.

Well, the patch did not apply with 'patch', so I had to apply it manually.
Unfortunately there is a bug: 

The larger tick value is smaller than the max, or it is drawn outside
the chart.

Just try:
---------------------
#! /usr/bin/perl -w
use Chart::LinesPoints;
@data=([2000..2200], [0..569]);
$obj=Chart::LinesPoints->new (600,400);
$obj->set ('max_y_ticks' => 20);
$obj->set ('min_y_ticks' => 2);
$obj->set ('integer_ticks_only' => 1);
$obj->png ("foo.png",\@data);
---------------------

Thanks for your effort,
Bill.




More information about the pkg-perl-maintainers mailing list