File: testmultixy.tcl

package info (click to toggle)
tklib 0.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,156 kB
  • sloc: tcl: 105,088; sh: 2,573; ansic: 792; pascal: 359; makefile: 69; sed: 53; exp: 21
file content (23 lines) | stat: -rwxr-xr-x 777 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /usr/bin/env tclsh
## -*- tcl -*-

# testmultixy.tcl --
#     Demonstrate how to plot a number of XY-plots above
#     each other with a common x-axis
#
#     Note that the upper limit for the axis is slightly
#     smaller than a full multiple of the step!
#
package require Plotchart

pack [canvas .c -width 500 -height 500]

set p1 [::Plotchart::createXYPlot .c {0.0 100.0 10.0} {0.0 19.9  5.0} -box {0 300 500 200}]

set plotarea [$p1 plotarea]
set width    [lindex $plotarea 4]

set p2 [::Plotchart::createXYPlot .c {0.0 100.0 ""}   {0.0 99.9 25.0} -axesbox [list $p1 nw 0 150 $width 150] -xlabels {}]
set p3 [::Plotchart::createXYPlot .c {0.0 100.0 ""}   {0.0  1.9  0.5} -axesbox [list $p2 nw 0 150 $width 150] -xlabels {}]

$p1 title "Multiple plots with one x-axis"