File: plotdemos8.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 (37 lines) | stat: -rwxr-xr-x 745 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
#! /bin/sh
# -*- tcl -*- \
exec tclsh "$0" ${1+"$@"}

package require Tcl 8.4
package require Tk

package require Plotchart


# plotdemos8.tcl --
#     Demonstration of a boxplot
#
pack [canvas .c] -fill both -side top

set p [::Plotchart::createBoxplot .c {0 40 5} {A B C D E F}]

$p plot data A {0 1 2 5 7 1 4 5 0.6 5 5.5}
$p plot data C {2 2 3 6 1.5 3}

$p plot data E {2 3 3 4 7 8 9 9 10 10 11 11 11 14 15 17 17 20 24 29}

#
# Demonstration of selected x labels - for version 1.6.2
#
if {0} {
set s [::Plotchart::createXYPlot .c2 {1990 2050 {}} {0.0 100.0 20.0} \
    -xlabels {1990 2020 2030 2050}]

$s xconfig -format "%.0f"

foreach {x y} {1990 32.0 2025 50.0 2030 60.0 2050 11.0 } {
    $s plot series1 $x $y
}

$s title "Data series"
}