[reportlab-users] y axis label with 2.77555756156e-017

Florian Reiser reportlab-users@reportlab.com
Fri, 19 Mar 2004 14:07:17 +0100


Hello Robin,

thanks for your help.
I'm now finally getting up to speed with reportlab.graphics.

With kind regards
Florian Reiser

-----Original Message-----
From: reportlab-users-admin@reportlab.com
[mailto:reportlab-users-admin@reportlab.com] On Behalf Of Robin Becker
Sent: Friday, March 19, 2004 12:23 PM
To: reportlab-users@reportlab.com
Subject: Re: [reportlab-users] y axis label with 2.77555756156e-017


In article <000001c40da2$043df990$6ac9280a@domw2k.int>, Florian Reiser
<florian.reiser@ra-bc.de> writes
>Hello,
>
>when I draw a chart with the following data,
>then the y axis shows 2.77555756156e-017
>instead 0.0.
>
># Begin data
>[(0.0, 0.0, None, None, None, None, None, None, None, None, None, None),
>(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
>(-0.036819999999999999, -0.073639999999999997, -0.11046,
>-0.14727999999999999, -0.18410000000000001, -0.22092000000000001,
>-0.25774000000000002, -0.29455999999999999, -0.33138000000000001,
>-0.36820000000000003, -0.40501999999999999, -0.44186799999999998),
>(None, None, None, None, None, None, None, None, None, None, None, None),
>(-0.31759999999999999, -0.442, None, None, None, None, None, None, None,
>None, None, None),
>(None, None, None, None, None, None, None, None, None, None, None, None),
>(None, None, None, None, None, None, None, None, None, None, None, None)] 
># End data
>
>Other charts with similar data work fine.
>
>Why?

well we have to do calculations etc to get the ranges and I guess the
tick interval didn't exactly hit the 0 when starring from its minimum.
This will always be a problem as floating point arithmetic is like that.

Your current labels are produced by applying str to the values. Probably
you need to specify a format operation.

ie valueAxis.labelTextFormat = '%.2f' or similar
>With kind regards
>Florian Reiser
>
>
>_______________________________________________
>reportlab-users mailing list
>reportlab-users@reportlab.com
>http://two.pairlist.net/mailman/listinfo/reportlab-users
>

-- 
Robin Becker
_______________________________________________
reportlab-users mailing list
reportlab-users@reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users