Tk Library Source Code

Check-in [c2f51c2498]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2018 Conference, Houston/TX, US, Oct 15-19
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Aug 20.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added R-chart example
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:c2f51c2498761ad64fc214018cc78fced3b15bb4
User & Date: arjenmarkus 2007-05-28 19:56:31
Context
2007-05-28
19:56
Added R-chart method check-in: eec7cb7e8a user: arjenmarkus tags: trunk
19:56
Added R-chart example check-in: c2f51c2498 user: arjenmarkus tags: trunk
2007-05-27
09:04
Corrected mistakes in vector drawing check-in: 058179d384 user: arjenmarkus tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to examples/plotchart/plotdemos6.tcl.

108
109
110
111
112
113
114



































        set angle  [expr {180.0*atan2($v,$u)/3.1415926}]
        set length [expr {(0.5+hypot($u,$v))/(1.0+hypot($u,$v))}]

        $s vector series1 $x $y $length $angle
    }
}









































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148

        set angle  [expr {180.0*atan2($v,$u)/3.1415926}]
        set length [expr {(0.5+hypot($u,$v))/(1.0+hypot($u,$v))}]

        $s vector series1 $x $y $length $angle
    }
}

#
# Simple demonstration of an R-chart
#
toplevel .rchart
canvas .rchart.c -background white -width 400 -height 200
pack   .rchart.c -fill both -side top

set s [::Plotchart::createXYPlot .rchart.c {0.0 100.0 10.0} {0.0 50.0 10.0}]

$s title "R-chart (arbitrary data)"

$s dataconfig series1 -colour "green"

for {set x 1.0} {$x < 50.0} {set x [expr {$x+3.0}]} {
    set y [expr {20.0 + 3.0*rand()}]
    $s rchart series1 $x $y
}

#
# Now some data outside the expected range
#

$s rchart series1 50.0 41.0
$s rchart series1 52.0 42.0
$s rchart series1 54.0 39.0

#
# And continue with the well-behaved series
#
for {set x 57.0} {$x < 100.0} {set x [expr {$x+3.0}]} {
    set y [expr {20.0 + 3.0*rand()}]
    $s rchart series1 $x $y
}