[reportlab-users] Re: Plotting with logarithmic axes

Robin Becker reportlab-users@reportlab.com
Wed, 30 Jul 2003 10:11:59 +0100


In article <seadawe96s.fsf@pc020549.dhcp.germanlloyd.org>, Berthold
Höllmann <hoel@gl-group.com> writes
>Dinu Gherman <gherman@darwin.in-berlin.de> writes:
>
>> Berthold Höllmann:
>>
>>> I also have some code which could be added to
>>> graphics/charts/lineplots.py, defining some classes for
>>> logplots. Those are "LogLinLinePlot" (plot logaritmic over linear
>>> axes), "LinLogLinePlot" (plot linear over logaritmic axes), and
>>> "LogLogLinePlot" (plot logaritmic over logaritmic axes) together with
>>> some examples.
>>
>> I'm not sure this is the way to go. Introducing new subclasses for
>> all sorts of little reasons to modify some basic thing like a plot
>> sounds evil to me.
>>
>> Can you think of a mechanism to just replace the (existing) linear
>> axes with logarithmic ones in a given LlinePlot instance, say, and
>> call a filter or mapping on the data to display as it should?
>
>You can simply replace <LinePlot>.[x,y]ValueAxis after instantiating
>the class, but that looks ugly to me. I would like the idea of
>arguments for the __init__ function of LinePlot to override the
>default ?ValueAxis. To go further, could PropHolder get an __init__
>function taking a ** argument to allow setting of props when
>instantiatiating a derived class.
>
>> This would be much closer to the meaning of components, instead of
>> an explosion of classes or functions for all variants of some thing.
>
>Regards
>Berthold
Dinu and Andy originally decided against arguments for some reason, but
Andy has now come round to the opposite view and has made a sort of
giant factory function (at least for simple excel like charts).
-- 
Robin Becker