File: plotdemos10.tcl

package info (click to toggle)
tklib 0.6%2B20190108-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 15,008 kB
  • sloc: tcl: 75,757; sh: 5,789; ansic: 792; pascal: 359; makefile: 70; sed: 53; exp: 21
file content (52 lines) | stat: -rwxr-xr-x 964 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
48
49
50
51
52
#!/usr/bin/env tclsh
## -*- tcl -*-

package require Tk

# plotdemos10.tcl --
#     Test and demonstrate wind roses, bands in xy-plots, vertical text and label-dots
#
package require Plotchart

#
# 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 [package provide Tk] 8.6] } {
    $p vtext "Vertical axis label"
}