Tk Library Source Code

View Ticket
Login
Ticket UUID: 8df371ba8ef47fc7d4d60fa652d857e91d1a7dc2
Title: ::Plotchart::createWindRose ::Plotchart::createWindRose
Type: Bug Version:
Submitter: anonymous Created on: 2023-08-07 20:34:41
Subsystem: tklib :: plotchart Assigned To: aku
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2023-08-13 11:39:45
Resolution: Fixed Closed By: arjenmarkus
    Closed on: 2023-08-13 11:39:45
Description:
2 errors:
1)
plotchart.tcl

(2.0.1)
proc ::Plotchart::polarToPixel { w rad phi } {
   variable torad

   set xcrd [expr {$rad*cos($phi*$torad)}]
   set ycrd [expr {$rad*sin($phi*$torad)}]

   coordsToPixel $w $xcrd $ycrd
}

newer Version (2.5.2)
#    Deprecated - use coordsToPixel instead
#
proc ::Plotchart::polarToPixel { w rad phi } {
   coordsToPixel $w $rad $phi
}

#   set xcrd [expr {$rad*cos($phi*$torad)}]
#   set ycrd [expr {$rad*sin($phi*$torad)}]
#  has been removed without replacement

2)
#that's missing: set scaling($w,new)  1
in
plotpriv.tcl
proc ::Plotchart::DrawWindRoseData
  variable scaling
  set scaling($w,new)  1





# example
pack [canvas .c -bg white]
set p [::Plotchart::createWindRose .c {30 6} 4]

$p plot {20  10  0 3} red
$p plot {10 10 10 3} blue
$p title "Simple wind rose - margins need to be corrected ..."
User Comments: arjenmarkus added on 2023-08-13 11:39:45:
Fixed - the scaling was incorrect (I had to drop the statement "set scaling($w,xfactor) 1.0"). Version number is now 2.6.1