Tk Library Source Code

View Ticket
Login
Ticket UUID: 1035281
Title: Plotchart::determineScale return wrong values
Type: Bug Version: None
Submitter: bwallner Created on: 2004-09-27 06:14:44
Subsystem: tklib :: plotchart Assigned To: arjenmarkus
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2004-11-08 19:18:02
Resolution: None Closed By: arjenmarkus
    Closed on: 2004-11-08 10:53:59
Description:
In this case Plotchart::determineScale returns wrong
values:

puts "-1.7 26.8: [determineScale -1.7 26.8]"

>> -1.7 26.8: -1.0 21.0 10.0 <<

Version Plotchart 0.9
User Comments: bwallner added on 2004-11-08 19:18:02:
Logged In: YES 
user_id=318308

All my test cases work fine.

Thank you.

arjenmarkus added on 2004-09-30 15:06:01:
Logged In: YES 
user_id=400048

Done, the code for drawing the numerical axes now treats
labels near zero as a special case

arjenmarkus added on 2004-09-30 13:53:58:
Logged In: YES 
user_id=400048

I will check this - it is simple to circumvent that problem
and I thought I had done that ...

bwallner added on 2004-09-30 13:36:55:
Logged In: YES 
user_id=318308

The return values of determineScale seem to be correct.

But the display of the scale in createBarchart seems to have
a rounding problem. Instead of 0.0 I get ...1512313e-17.
Example:
package require Plotchart
pack [canvas .c -background white]
set dimScale [Plotchart::determineScale -1.07 -0.01]
puts $dimScale
set bc [Plotchart::createBarchart .c {f3d2 d3c2 h2h4}
$dimScale 3]
$bc plot 0 {-0.62 -0.67 -1.07} #000000
$bc plot 1 {-0.64 -0.71 -1.01} #FFFFCC
$bc plot 2 {-0.01 -0.01 -0.88} #00CCCC

arjenmarkus added on 2004-09-29 18:25:37:
Logged In: YES 
user_id=400048

Fixed the problem - a missing factor "$factor" when
adjusting the raw ranges. 

Could you confirm that the values returned by determineScale
are now correct?