Graphing items
The Slate includes a number of item types that assist the
construction of graphs (of the x-versusy kind, not the
vertices-and-edges kind). The Slate is by no means the fastest way of
drawing graphs ([incr Tcl] is fully interpreted and the Slate adds a
fair amount of overhead), but it's still very handy for rapid
prototyping.
Axis is an "axis" of a graph. It has the following options
- -digits. The number of digits after the decimal point to
display in the axis labels. If zero, none are displayed. The default is
the zero.
- -from. The value at the start (left or bottom) of the axis.
The default is zero.
- -length. The length of the axis, in pixels. The default is
200 (a completely arbitrary choice, but you have to have something).
- -ticklength. The length of the "tick" marks on the axis, in pixels.
The default is six.
- -to. The value at the end (right or top) of the axis.
The default is 100.
The coordinates of the Axis are the x and y positions of
the axis origin.
Enhancements: (i) The Axis needs a -orientation
option with values horizontal and vertical. (ii) There is
no way to control the spacing between tick marks -- one of these days,
this might be useful. (iii) We should be able to select which
side of the axis the tick marks appear on.
Example: Create an axis:
source $tycho/editors/slate/doc/internals/newslate.itcl
$slate create Axis 20 60 -digits 1 -from 0 -to 2 \
-length 320 -tags moveable
Strip
Strip is a strip of colored boxes, as used in things like bar
charts and Gantt charts (which is why we're implementing it). Because,
however, the current code is very flaky, we have not included it in
this release.
Back up
Tycho Home Page
Copyright © 1996, The Regents of the University of California.
All rights reserved.
Last updated: 96/12/11,
comments to: johnr@eecs.berkeley.edu