File: plotdemos10.tcl

package info (click to toggle)
tklib 0.6-1%2Bdeb8u1
  • links: PTS
  • area: main
  • in suites: jessie
  • size: 16,112 kB
  • ctags: 4,008
  • sloc: tcl: 65,204; sh: 6,870; ansic: 792; pascal: 359; makefile: 73; exp: 21; sed: 16
file content (47 lines) | stat: -rwxr-xr-x 893 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# plotdemos10.tcl --
#     Test and demonstrate wind roses, bands in xy-plots, vertical text and label-dots
#
package require Plotchart 1.7

#
# Wind rose diagram
#
pack [canvas .c1 -bg white]

set p [::Plotchart::createWindRose .c1 {30 6} 4]

$p plot {5 10 0 3} red
$p plot {10 10 10 3} blue

$p title "Simple wind rose - margins need to be corrected ..."

#
# Bands in two directions
#
pack [canvas .c2 -bg white] -side top

set p [::Plotchart::createXYPlot .c2 {0 10 2} {0 40 10}]

$p plot data 1 10
$p plot data 6 20
$p plot data 9 10

$p xband 15 25
$p yband 3 5

#
# Label-dots and vertical text
#

pack [canvas .c3 -bg white] -side top

set p [::Plotchart::createXYPlot .c3 {0 10 2} {0 40 10}]

$p labeldot 3 10 "Point 1" w
$p labeldot 6 20 "Point 2" e
$p labeldot 9 10 "Point 3" n
$p labeldot 9 30 "Point 4" s

if { [package vsatisfies Tk 8.6] } {
    $p vtext "Vertical axis label"
}