#!/bin/sh #\ exec wish $0 $@ source emu-graph1.1.2/tcl/graph.tcl # Datensätze set Januar [list 1702 2.0 1708 1.4 1730 1.8 1749 2.6 1760 -.8 1775 -.8 1800 -3.4 1820 -5.8 1840 -2.3 1860 2.0 1900 .9 1920 1.9 1950 -1.4 1970 -4.1 1990 4.1] set April [list 1702 2.6 1708 6.1 1730 9.0 1749 8.0 1760 9.9 1775 7.6 1800 13.9 1820 10.3 1840 8.2 1860 7.9 1900 7.7 1920 10.8 1950 7.9 1970 6.4 1990 9.5] set Juli [list 1702 16.0 1708 12.1 1730 16.8 1749 18.0 1760 19.5 1775 21.0 1800 16.2 1820 15.9 1840 18.8 1860 17.6 1900 20.8 1920 18.9 1950 18.4 1970 18.1 1990 18.1] set Oktober [list 1702 7.5 1708 1.4 1730 5.0 1749 8.2 1760 10.5 1775 10.1 1800 8.0 1820 9.8 1840 9.9 1860 8.5 1900 10.0 1920 6.4 1950 8.4 1970 9.9 1990 10.8] set Dezember [list 1702 .6 1708 -4.6 1730 1.0 1749 3.2 1760 4.9 1775 2.3 1800 -.4 1820 -2.8 1840 4.7 1860 -2.1 1900 3.4 1920 .0 1950 -1.0 1970 2.0 1990 1.2] set Jahresmittel [list 1702 6.8 1708 6.2 1730 8.6 1749 9.2 1760 10.2 1775 10.3 1800 8.4 1820 7.9 1840 9.2 1860 8.4 1900 9.7 1920 9.1 1950 9.3 1970 8.8 1990 10.8] # Widgets erzeugen canvas .c -width 600 -height 400 -bg white pack .c emu_graph::emu_graph graph -canvas .c -width 400 -height 300 # Daten schreiben graph data Januar -points 1 -lines 1 -coords $Januar -colour red graph data April -points 1 -lines 1 -coords $April -colour yellow graph data Juli -points 1 -lines 1 -coords $Juli -colour green graph data Oktober -points 1 -lines 1 -coords $Oktober -colour cyan graph data Dezember -points 1 -lines 1 -coords $Dezember -colour blue graph data Jahresmittel -lines 1 -coords $Jahresmittel -colour gray # Legende erstellen set y 30 .c create text 500 [incr y 20] -text Januar -fill red .c create text 500 [incr y 20] -text April -fill yellow .c create text 500 [incr y 20] -text Juli -fill green .c create text 500 [incr y 20] -text Oktober -fill cyan -tag Oktober .c create text 500 [incr y 20] -text Dezember -fill blue .c create text 500 [incr y 20] -text Jahresmittel -fill gray # Anzeige ändern .c itemconfigure Januar -dash {2 4} .c itemconfigure Jahresmittel -width 2 # Werte in Canvas-Koordinaten umwandeln set x1900 [graph x2canvas 1900] set y5 [graph y2canvas 5] .c create text $x1900 $y5 -text "\u00D7" .c create text $x1900 $y5 -text "1900, 5\u00b0 cel." -anchor sw