Debian Codegraph @

man/stripchart.mann

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 '\" Copyright 1991-1997 by Bell Labs Innovations for Lucent Technologies.
2 '\"
3 '\" Permission to use, copy, modify, and distribute this software and its
4 '\" documentation for any purpose and without fee is hereby granted, provided
5 '\" that the above copyright notice appear in all copies and that both that the
6 '\" copyright notice and warranty disclaimer appear in supporting documentation,
7 '\" and that the names of Lucent Technologies any of their entities not be used
8 '\" in advertising or publicity pertaining to distribution of the software
9 '\" without specific, written prior permission.
10 '\"
11 '\" Lucent Technologies disclaims all warranties with regard to this software,
12 '\" including all implied warranties of merchantability and fitness. In no event
13 '\" shall Lucent Technologies be liable for any special, indirect or
14 '\" consequential damages or any damages whatsoever resulting from loss of use,
15 '\" data or profits, whether in an action of contract, negligence or other
16 '\" tortuous action, arising out of or in connection with the use or performance
17 '\" of this software.
18 '\"
19 '\" Stripchart widget created by Sani Nassif and George Howlett.
20 '\"
21 .so man.macros
22 .TH stripchart n BLT_VERSION BLT "BLT Built-In Commands"
23 .BS
24 '\" Note: do not modify the .SH NAME line immediately below!
25 .SH NAME
26 stripchart \- 2D strip chart for plotting x and y coordinate data.
27 .SH SYNOPSIS
28 \fBstripchart\fI \fIpathName \fR?\fIoption value\fR?...
29 .BE
30 .SH DESCRIPTION
31 The \fBstripchart\fR command creates a strip chart for plotting
32 two-dimensional data (x,y coordinates). It has many configurable
33 components: coordinate axes, elements, legend, grid lines, cross
34 hairs, etc. They allow you to customize the look and feel of the
35 strip chart.
36 .PP
37 The \fBstripchart\fR is essentially the same as the \fBgraph\fR
38 widget. It works almost exactly the very same way.
39 .PP
40 The use of a strip chart differs in that the X-axis typically refers
41 to time points. Data values are added at intervals. The strip chart
42 lets you automatically maintain a view of the most recent time points.
43 The axis options \fB\-shiftby\fR and \fB\-autorange\fR control this.
44 You can specify different line styles for data points (see the
45 \fB\-styles\fR option).
46 .SH INTRODUCTION
47 The \fBstripchart\fR command creates a new window for plotting
48 two-dimensional data (x,y coordinates). Data points are plotted in a
49 box displayed in the center of the new window. This is the
50 \fIplotting area\fR. The coordinate axes are displayed in the
51 margins around the plotting area. By default, the legend is displayed
52 in the right margin. The title is displayed in top margin.
53 .PP
54 A strip chart is composed of several components: coordinate axes, data
55 elements, legend, grid, cross hairs, pens, postscript, and annotation
56 markers.
57 .TP 1i
58 \fBaxis\fR
59 The stripchart widget can display up to four coordinate axes (two
60 X-coordinate and two Y-coordinate axes), but you can create and use
61 any number of axes. Axes control what region of data is displayed and
62 how the data is scaled. Each axis consists of the axis line, title,
63 major and minor ticks, and tick labels. Tick labels display the value
64 of each major tick.
65 .TP 1i
66 \fBcrosshairs\fR
67 Cross hairs are used to finely position the mouse pointer in relation
68 to the coordinate axes. Two perpendicular lines are drawn across the
69 plotting area, intersecting at the current location of the mouse
70 pointer.
71 .TP 1i
72 \fBelement\fR
73 An element represents a set of data points. Elements can be plotted
74 with a symbol at each data point and lines connecting the points.
75 The appearance of the element, such as its symbol, line width, and
76 color is configurable.
77 .TP 1i
78 \fBgrid\fR
79 Extends the major and minor ticks of the X\-axis and/or Y\-axis across the
80 plotting area.
81 .TP 1i
82 \fBlegend\fR
83 The legend displays the name and symbol of each data element.
84 The legend can be drawn in any margin or in the plotting area.
85 .TP 1i
86 \fBmarker\fR
87 Markers are used annotate or highlight areas of the graph. For
88 example, you could use a polygon marker to fill an area under a
89 curve, or a text marker to label a particular data point. Markers
90 come in various forms: text strings, bitmaps, connected line
91 segments, images, polygons, or embedded widgets.
92 .TP 1i
93 \fBpen\fR
94 Pens define attributes (both symbol and line style) for elements.
95 Data elements use pens to specify how they should be drawn. A data
96 element may use many pens at once. Here, the particular pen
97 used for a data point is determined from each element's weight
98 vector (see the element's \fB\-weight\fR and \fB\-style\fR options).
99 .TP 1i
100 \fBpostscript\fR
101 The widget can generate encapsulated PostScript output. This component
102 has several options to configure how the PostScript is generated.
103 .SH SYNTAX
104 .DS
105 \fBstripchart \fIpathName \fR?\fIoption value\fR?...
106 .DE
107 The \fBstripchart\fR command creates a new window \fIpathName\fR and makes
108 it into a \fBstripchart\fR widget. At the time this command is invoked, there
109 must not exist a window named \fIpathName\fR, but \fIpathName\fR's
110 parent must exist. Additional options may may be specified on the
111 command line or in the option database to configure aspects of the
112 strip chart such as its colors and font. See the \fBconfigure\fR operation
113 below for the exact details as to what \fIoption\fR and \fIvalue\fR
114 pairs are valid.
115 .PP
116 If successful, \fBstripchart\fR returns the path name of the widget. It
117 also creates a new Tcl command by the same name. You can use this
118 command to perform various operations that query or modify the graph.
119 The general form is:
120 .DS
121 \fIpathName \fIoperation\fR \fR?\fIarg\fR?...
122 .DE
123 Both \fIoperation\fR and its arguments determine the exact behavior of
124 the command. The operations available for the strip chart are described in
125 the
126 .SB "STRIPCHART OPERATIONS"
127 section.
128 .PP
129 The command can also be used to access components of the strip chart.
130 .DS
131 \fIpathName component operation\fR ?\fIarg\fR?...
132 .DE
133 The operation, now located after the name of the component, is the
134 function to be performed on that component. Each component has its own
135 set of operations that manipulate that component. They will be
136 described below in their own sections.
137 .SH EXAMPLE
138 The \fBstripchart\fR command creates a new strip chart.
139 .CS
140 # Create a new strip chart. Plotting area is black.
141 stripchart .s -plotbackground black
142 .CE
143 A new Tcl command \fB.s\fR is also created. This command can be used
144 to query and modify the strip chart. For example, to change the title of
145 the strip chart to "My Plot", you use the new command and the widget's
146 \fBconfigure\fR operation.
147 .CS
148 # Change the title.
149 \&.s configure \-title "My Plot"
150 .CE
151 A strip chart has several components. To access a particular component you
152 use the component's name. For example, to add data elements, you use
153 the new command and the \fBelement\fR component.
154 .CS
155 # Create a new element named "line1"
156 \&.s element create line1 \\
157 \-xdata { 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 } \\
158 \-ydata { 26.18 50.46 72.85 93.31 111.86 128.47 143.14
159 155.85 166.60 175.38 }
160 .CE
161 The element's X and Y coordinates are specified using lists of
162 numbers. Alternately, BLT vectors could be used to hold the X\-Y
163 coordinates.
164 .CS
165 # Create two vectors and add them to the strip chart.
166 vector xVec yVec
167 xVec set { 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 }
168 yVec set { 26.18 50.46 72.85 93.31 111.86 128.47 143.14 155.85
169 166.60 175.38 }
170 \&.s element create line1 \-xdata xVec \-ydata yVec
171 .CE
172 The advantage of using vectors is that when you modify one, the graph
173 is automatically redrawn to display the new values.
174 .CS
175 # Change the X\-Y coordinates of the first point.
176 set xVec(0) 0.18
177 set yVec(0) 25.18
178 .CE
179 An element named \fBline1\fR is now created in \fB.s\fR. By
180 default, the element's label in the legend will be also \fBline1\fR.
181 You can change the label, or specify no legend entry, again using the
182 element's \fBconfigure\fR operation.
183 .CS
184 # Don't display "line1" in the legend.
185 \&.s element configure line1 -label ""
186 .CE
187 You can configure more than just the element's label. An element has
188 many attributes such as symbol type and size, dashed or solid lines,
189 colors, line width, etc.
190 .CS
191 \&.s element configure line1 -symbol square -color red \\
192 -dashes { 2 4 2 } -linewidth 2 -pixels 2c
193 .CE
194 Four coordinate axes are automatically created: \fBx\fR, \fBx2\fR,
195 \fBy\fR, and \fBy2\fR. And by default, elements are mapped onto the
196 axes \fBx\fR and \fBy\fR. This can be changed with the \fB\-mapx\fR
197 and \fB\-mapy\fR options.
198 .CS
199 # Map "line1" on the alternate Y-axis "y2".
200 \&.s element configure line1 -mapy y2
201 .CE
202 Axes can be configured in many ways too. For example, you change the
203 scale of the Y-axis from linear to log using the \fBaxis\fR operation.
204 .CS
205 # Y-axis is log scale.
206 \&.s axis configure y -logscale yes
207 .CE
208 Axis limits are reset by simply specifying new axis
209 limits using the \fB\-min\fR and \fB\-max\fR configuration options.
210 .CS
211 \&.s axis configure x -min 1.0 -max 1.5
212 \&.s axis configure y -min 12.0 -max 55.15
213 .CE
214 By default, the limits of the axis are determined from data values.
215 To reset back to the default limits, set the \fB\-min\fR and
216 \fB\-max\fR options to the empty value.
217 .CS
218 # Reset the axes to autoscale again.
219 \&.s axis configure x -min {} -max {}
220 \&.s axis configure y -min {} -max {}
221 .CE
222 It's common with strip charts to automatically maintain a view of
223 the most recent time points. You can do this my setting the
224 \fB\-autorange\fR option.
225 .CS
226 \&.s axis configure x -autorange 20.0
227 .CE
228 If the time points are added in X-coordinates 1.0 unit, only the last
229 twenty time points will be displayed. As more data
230 is added, the view will march along.
231 .PP
232 Sometimes the rate of data is so high that changing the axis limits
233 with each additional time point is prohibitive. You can use the
234 \fB\-shiftby\fR option to define an increment to shift the view
235 when needed.
236 .CS
237 \&.s axis configure x -shiftby 15.0
238 .CE
239 When the view is shifted, it will allow a range of 15
240 new time points to be added until the axis limits are recomputed.
241 .PP
242 By default, the legend is displayed in the right margin. You can
243 change this or any other legend configuration options using the
244 \fBlegend\fR component.
245 .CS
246 # Configure the legend font, color, and relief
247 \&.s legend configure -position left -relief raised \\
248 -font fixed -fg blue
249 .CE
250 To prevent the legend from being displayed, turn on the \fB\-hide\fR
251 option.
252 .CS
253 # Don't display the legend.
254 \&.s legend configure -hide yes\fR
255 .CE
256 The \fBstripchart\fR widget has simple drawing procedures called markers.
257 They can be used to highlight or annotate data in the strip chart. The types
258 of markers available are bitmaps, images, polygons, lines, or windows.
259 Markers can be used, for example, to mark or brush points. Here
260 is a text marker which labels the data first point. Markers
261 are created using the \fBmarker\fR operation.
262 .CS
263 # Create a label for the first data point of "line1".
264 \&.s marker create text \-name first_marker \-coords { 0.2 26.18 } \\
265 \-text "start" \-anchor se \-xoffset -10 \-yoffset -10
266 .CE
267 This creates a text marker named \fBfirst_marker\fR. It will display
268 the text "start" near the coordinates of the first data point. The
269 \fB\-anchor\fR, \fB\-xoffset\fR, and \fB\-yoffset\fR options are used
270 to display the marker above and to the left of the data point, so that
271 the actual data point isn't covered by the marker. By default,
272 markers are drawn last, on top of data. You can change this with the
273 \fB\-under\fR option.
274 .CS
275 # Draw the label before elements are drawn.
276 \&.s marker configure first_marker -under yes
277 .CE
278 You can add cross hairs or grid lines using the \fBcrosshairs\fR and
279 \fBgrid\fR operations.
280 .CS
281 # Display both cross hairs and grid lines.
282 \&.s crosshairs configure \-hide no \-color red
283 \&.s grid configure \-hide no \-dashes { 2 2 }
284 .CE
285 Finally, to get hardcopy of the strip chart, use the \fBpostscript\fR
286 operation.
287 .CS
288 # Print the strip chart into file "file.ps"
289 \&.s postscript output file.ps \-maxpect yes \-decorations no
290 .CE
291 This generates a file \fBfile.ps\fR containing the encapsulated
292 PostScript of the strip chart. The option \fB\-maxpect\fR says to scale the
293 plot to the size of the page. Turning off the \fB\-decorations\fR
294 option indicates that no borders or color backgrounds should be
295 displayed (i.e. the background of the margins, legend, and plotting
296 area will be white).
297 .SH "STRIPCHART OPERATIONS"
298 .TP
299 \fIpathName \fBaxis \fIoperation\fR ?\fIarg\fR?...
300 See the
301 .SB "AXIS COMPONENTS"
302 section.
303 .TP
304 \fIpathName \fBbar \fIelemName \fR?\fIoption value\fR?...
305 Creates a new barchart element \fIelemName\fR. It's an
306 error if an element \fIelemName\fR already exists.
307 See the manual for \fBbarchart\fR for details about
308 what \fIoption\fR and \fIvalue\fR pairs are valid.
309 .TP
310 \fIpathName \fBcget\fR \fIoption\fR
311 Returns the current value of the stripchart configuration option given by
312 \fIoption\fR. \fIOption\fR may be any option described
313 below for the \fBconfigure\fR operation.
314 .TP
315 \fIpathName \fBconfigure \fR?\fIoption value\fR?...
316 Queries or modifies the configuration options of the strip chart. If
317 \fIoption\fR isn't specified, a list describing all of the current
318 options for \fIpathName\fR is returned. If \fIoption\fR is specified,
319 but not \fIvalue\fR, then a list describing \fIoption\fR is returned.
320 If one or more \fIoption\fR and \fIvalue\fR pairs are specified, then
321 for each pair, the stripchart option \fIoption\fR is set to \fIvalue\fR.
322 The following options are valid for the stripchart.
323 .RS
324 .TP
325 \fB\-background \fIcolor\fR
326 Sets the background color. This includes the margins and
327 legend, but not the plotting area.
328 .TP
329 \fB\-borderwidth \fIpixels\fR
330 Sets the width of the 3\-D border around the outside edge of the widget. The
331 \fB\-relief\fR option determines if the border is to be drawn. The
332 default is \fB2\fR.
333 .TP
334 \fB\-bottommargin \fIpixels\fR
335 Specifies the size of the margin below the X\-coordinate axis. If
336 \fIpixels\fR is \fB0\fR, the size of the margin is selected automatically.
337 The default is \fB0\fR.
338 .TP
339 \fB\-bufferelements \fIboolean\fR
340 Indicates whether to draw elements into a pixmap before displaying
341 them on the screen. The advantage of buffering elements is when markers
342 are used heavily. Markers can be moved and redrawn without requiring
343 every element to be redrawn again. The disadvantage is that it takes
344 slightly longer to draw the graph. If \fIboolean\fR is true, data elements are
345 drawn to an internal pixmap. The option should be turned off if the plot
346 is updated frequently. See the
347 .SB "SPEED TIPS"
348 section.
349 The default is \fB1\fR.
350 .TP
351 \fB\-buffergraph \fIboolean\fR
352 Indicates whether to draw the graph into a pixmap first.
353 If \fIboolean\fR is true, the entire graph is drawn into a pixmap and then
354 copied onto the screen. This reduces flashing. If false, the graph is
355 drawn directly into the window. Especially under Windows, turning off the
356 option can be helpful when the stripchart is updated frequently. Turning
357 off this option also turns \fB\-bufferelements\fR off. See the
358 .SB "SPEED TIPS"
359 section.
360 The default is \fB1\fR.
361 .TP
362 \fB\-cursor \fIcursor\fR
363 Specifies the widget's cursor. The default
364 cursor is \fBcrosshair\fR.
365 .TP
366 \fB\-font \fIfontName\fR
367 Specifies the title font. The default is
368 \fB*-Helvetica-Bold-R-Normal-*-18-180-*\fR.
369 .TP
370 \fB\-halo \fIpixels\fR
371 Specifies a maximum distance to consider when searching for the
372 closest data point (see the element's \fBclosest\fR operation below).
373 Data points further than \fIpixels\fR away are ignored. The default is
374 \fB0.5i\fR.
375 .TP
376 \fB\-height \fIpixels\fR
377 Specifies the requested height of widget. The default is
378 \fB4i\fR.
379 .TP
380 \fB\-invertxy \fIboolean\fR
381 Indicates whether the placement X\-axis and Y\-axis should be inverted. If
382 \fIboolean\fR is true, the X and Y axes are swapped. The default is
383 \fB0\fR.
384 .TP
385 \fB\-justify \fIjustify\fR
386 Specifies how the title should be justified. This matters only when
387 the title contains more than one line of text. \fIJustify\fR must be
388 \fBleft\fR, \fBright\fR, or \fBcenter\fR. The default is
389 \fBcenter\fR.
390 .TP
391 \fB\-leftmargin \fIpixels\fR
392 Sets the size of the margin from the left edge of the window to
393 the Y\-coordinate axis. If \fIpixels\fR is \fB0\fR, the size is
394 calculated automatically. The default is \fB0\fR.
395 .TP
396 \fB\-plotbackground \fIcolor\fR
397 Specifies the background color of the plotting area. The default is
398 \fBwhite\fR.
399 .TP
400 \fB\-plotborderwidth \fIpixels\fR
401 Sets the width of the 3-D border around the plotting area. The
402 \fB\-plotrelief\fR option determines if a border is drawn. The
403 default is \fB2\fR.
404 .TP
405 \fB\-plotpadx \fIpad\fR
406 Sets the amount of padding to be added to the left and right sides of
407 the plotting area. \fIPad\fR can be a list of one or two screen
408 distances. If \fIpad\fR has two elements, the left side of the
409 plotting area entry is padded by the first distance and the right side
410 by the second. If \fIpad\fR is just one distance, both the left and
411 right sides are padded evenly. The default is \fB8\fR.
412 .TP
413 \fB\-plotpady \fIpad\fR
414 Sets the amount of padding to be added to the top and bottom of the
415 plotting area. \fIPad\fR can be a list of one or two screen
416 distances. If \fIpad\fR has two elements, the top of the plotting
417 area is padded by the first distance and the bottom by the second. If
418 \fIpad\fR is just one distance, both the top and bottom are padded
419 evenly. The default is \fB8\fR.
420 .TP
421 \fB\-plotrelief \fIrelief\fR
422 Specifies the 3-D effect for the plotting area. \fIRelief\fR
423 indicates how the interior of the plotting area should appear relative
424 to rest of the strip chart; for example, \fBraised\fR means the plot should
425 appear to protrude from the strip chart, relative to the surface of the
426 strip chart. The default is \fBsunken\fR.
427 .TP
428 \fB\-relief \fIrelief\fR
429 Specifies the 3-D effect for the widget. \fIRelief\fR
430 indicates how the strip chart should appear relative to widget it is packed
431 into; for example, \fBraised\fR means the strip chart should
432 appear to protrude. The default is \fBflat\fR.
433 .TP
434 \fB\-rightmargin \fIpixels\fR
435 Sets the size of margin from the plotting area to the right edge of
436 the window. By default, the legend is displayed in this margin. If
437 \fIpixels\fR is than 1, the margin size is selected automatically.
438 .TP
439 \fB\-takefocus\fR \fIfocus\fR
440 Provides information used when moving the focus from window to window
441 via keyboard traversal (e.g., Tab and Shift-Tab). If \fIfocus\fR is
442 \fB0\fR, this means that this window should be skipped entirely during
443 keyboard traversal. \fB1\fR means that the this window should always
444 receive the input focus. An empty value means that the traversal
445 scripts make the decision whether to focus on the window.
446 The default is \fB""\fR.
447 .TP
448 \fB\-tile \fIimage\fR
449 Specifies a tiled background. If \fIimage\fR isn't
450 \fB""\fR, the background is tiled using \fIimage\fR.
451 Otherwise, the normal background color is drawn (see the
452 \fB\-background\fR option). \fIImage\fR must be an image created
453 using the Tk \fBimage\fR command. The default is \fB""\fR.
454 .TP
455 \fB\-title \fItext\fR
456 Sets the title to \fItext\fR. If \fItext\fR is \fB""\fR,
457 no title will be displayed.
458 .TP
459 \fB\-topmargin \fIpixels\fR
460 Specifies the size of the margin above the x2 axis. If \fIpixels\fR
461 is \fB0\fR, the margin size is calculated automatically.
462 .TP
463 \fB\-width \fIpixels\fR
464 Specifies the requested width of the widget. The default is
465 \fB5i\fR.
466 .RE
467 .TP
468 \fIpathName \fBcrosshairs \fIoperation \fR?\fIarg\fR?
469 See the
470 .SB "CROSSHAIRS COMPONENT"
471 section.
472 .TP
473 \fIpathName \fBelement \fIoperation \fR?\fIarg\fR?...
474 See the
475 .SB "ELEMENT COMPONENTS"
476 section.
477 .TP
478 \fIpathName \fBextents \fIitem\fR
479 Returns the size of a particular item in the strip chart. \fIItem\fR must
480 be either \fBleftmargin\fR, \fBrightmargin\fR, \fBtopmargin\fR,
481 \fBbottommargin\fR, \fBplotwidth\fR, or \fBplotheight\fR.
482 .TP
483 \fIpathName \fBgrid \fIoperation \fR?\fIarg\fR?...
484 See the
485 .SB "GRID COMPONENT"
486 section.
487 .TP
488 \fIpathName \fBinvtransform \fIwinX winY\fR
489 Performs an inverse coordinate transformation, mapping window
490 coordinates back to graph coordinates, using the standard X\-axis and Y\-axis.
491 Returns a list of containing the graph coordinates.
492 .TP
493 \fIpathName \fBlegend \fIoperation \fR?\fIarg\fR?...
494 See the
495 .SB "LEGEND COMPONENT"
496 section.
497 .TP
498 \fIpathName \fBline \fIelemName\fR ?\fIoption value\fR?...
499 The operation is the same as \fBelement\fR.
500 .TP
501 \fIpathName \fBmarker \fIoperation \fR?\fIarg\fR?...
502 See the
503 .SB "MARKER COMPONENTS"
504 section.
505 .TP
506 \fIpathName\fR \fBmetafile\fR ?\fIfileName\fR?
507 \fIThis operation is for Window platforms only\fR.
508 Creates a Windows enhanced metafile of the stripchart.
509 If present, \fIfileName\fR is the file name of the new metafile.
510 Otherwise, the metafile is automatically added to the clipboard.
511 .TP
512 \fIpathName \fBpostscript \fIoperation \fR?\fIarg\fR?...
513 See the
514 .SB "POSTSCRIPT COMPONENT"
515 section.
516 .TP
517 \fIpathName \fBsnap \fIphotoName\fR
518 Takes a snapshot of the strip chart and stores the contents in the photo
519 image \fIphotoName\fR. \fIPhotoName\fR is the name of a Tk photo
520 image that must already exist.
521 .TP
522 \fIpathName \fBtransform \fIx y\fR
523 Performs a coordinate transformation, mapping graph coordinates to
524 window coordinates, using the standard X\-axis and Y\-axis.
525 Returns a list containing the X\-Y screen coordinates.
526 .TP
527 \fIpathName \fBxaxis \fIoperation\fR ?\fIarg\fR?...
528 .TP
529 \fIpathName \fBx2axis \fIoperation\fR ?\fIarg\fR?...
530 .TP
531 \fIpathName \fByaxis \fIoperation\fR ?\fIarg\fR?...
532 .TP
533 \fIpathName \fBy2axis \fIoperation\fR ?\fIarg\fR?...
534 See the
535 .SB "AXIS COMPONENTS"
536 section.
537 .SH "STRIPCHART COMPONENTS"
538 A strip chart is composed of several components: coordinate axes, data
539 elements, legend, grid, cross hairs, postscript, and annotation
540 markers. Instead of one big set of configuration options and
541 operations, the strip chart is partitioned, where each component has its own
542 configuration options and operations that specifically control that
543 aspect or part of the strip chart.
544 .SS "AXIS COMPONENTS"
545 Four coordinate axes are automatically created: two X\-coordinate axes
546 (\fBx\fR and \fBx2\fR) and two Y\-coordinate axes (\fBy\fR, and
547 \fBy2\fR). By default, the axis \fBx\fR is located in the bottom
548 margin, \fBy\fR in the left margin, \fBx2\fR in the top margin, and
549 \fBy2\fR in the right margin.
550 .PP
551 An axis consists of the axis line, title, major and minor ticks, and
552 tick labels. Major ticks are drawn at uniform intervals along the
553 axis. Each tick is labeled with its coordinate value. Minor ticks
554 are drawn at uniform intervals within major ticks.
555 .PP
556 The range of the axis controls what region of data is plotted.
557 Data points outside the minimum and maximum limits of the axis are
558 not plotted. By default, the minimum and maximum limits are
559 determined from the data, but you can reset either limit.
560 .PP
561 You can create and use several axes. To create an axis, invoke
562 the axis component and its create operation.
563 .CS
564 # Create a new axis called "temperature"
565 \&.s axis create temperature
566 .CE
567 You map data elements to an axis using the element's \-mapy and \-mapx
568 configuration options. They specify the coordinate axes an element
569 is mapped onto.
570 .CS
571 # Now map the temperature data to this axis.
572 \&.s element create "temp" \-xdata $x \-ydata $tempData \\
573 \-mapy temperature
574 .CE
575 While you can have many axes, only four axes can be displayed
576 simultaneously. They are drawn in each of the margins surrounding the
577 plotting area. The axes x and y are drawn in the bottom and left
578 margins. The axes x2 and y2 are drawn in top and right margins.
579 Only x and y are shown by default. Note that the axes can have
580 different scales.
581 .PP
582 To display a different axis, you invoke one of the following
583 components: \fBxaxis\fR, \fByaxis\fR, \fBx2axis\fR, and \fBy2axis\fR.
584 The \fBuse\fR operation designates the axis to be drawn in the
585 corresponding margin: \fBxaxis\fR in the bottom, \fByaxis\fR in the left,
586 \fBx2axis\fR in the top, and \fBy2axis\fR in the right.
587 .CS
588 # Display the axis temperature in the left margin.
589 \&.s yaxis use temperature
590 .CE
591 .PP
592 You can configure axes in many ways. The axis scale can be linear or
593 logarithmic. The values along the axis can either monotonically
594 increase or decrease. If you need custom tick labels, you can specify
595 a Tcl procedure to format the label as you wish. You can
596 control how ticks are drawn, by changing the major tick interval
597 or the number of minor ticks. You can define non-uniform tick intervals,
598 such as for time-series plots.
599 .PP
600 .TP
601 \fIpathName \fBaxis \fBcget \fIaxisName \fIoption\fR
602 Returns the current value of the option given by \fIoption\fR for
603 \fIaxisName\fR. \fIOption\fR may be any option described below
604 for the axis \fBconfigure\fR operation.
605 .TP
606 \fIpathName \fBaxis \fBconfigure \fIaxisName \fR?\fIoption value\fR?...
607 Queries or modifies the configuration options of \fIaxisName\fR. If
608 \fIoption\fR isn't specified, a list describing all the current
609 options for \fIaxisName\fR is returned. If \fIoption\fR is specified, but
610 not \fIvalue\fR, then a list describing \fIoption\fR is
611 returned. If one or more \fIoption\fR and \fIvalue\fR pairs are
612 specified, then for each pair, the axis option \fIoption\fR is set to
613 \fIvalue\fR.
614 The following options are valid for axes.
615 .RS
616 .TP
617 \fB\-autorange \fIrange\fR
618 Sets the range of values for the axis to \fIrange\fR. The axis limits
619 are automatically reset to display the most recent data points in this range.
620 If \fIrange\fR is 0.0, the range is
621 determined from the limits of the data. If \fB\-min\fR or \fB-max\fR
622 are specified, they override this option. The default is \fB0.0\fR.
623 .TP
624 \fB\-color \fIcolor\fR
625 Sets the color of the axis and tick labels.
626 The default is \fBblack\fR.
627 .TP
628 \fB\-command \fIprefix\fR
629 Specifies a Tcl command to be invoked when formatting the axis tick
630 labels. \fIPrefix\fR is a string containing the name of a Tcl proc and
631 any extra arguments for the procedure. This command is invoked for each
632 major tick on the axis. Two additional arguments are passed to the
633 procedure: the pathname of the widget and the current the numeric
634 value of the tick. The procedure returns the formatted tick label. If
635 \fB""\fR is returned, no label will appear next to the tick. You can
636 get the standard tick labels again by setting \fIprefix\fR to
637 \fB""\fR. The default is \fB""\fR.
638 .sp 1
639 Please note that this procedure is invoked while the strip chart is redrawn.
640 You may query the configuration options. But do not reset them, because
641 this can have unexpected results.
642 .TP
643 \fB\-descending \fIboolean\fR
644 Indicates whether the values along the axis are monotonically increasing or
645 decreasing. If \fIboolean\fR is true, the axis values will be
646 decreasing. The default is \fB0\fR.
647 .TP
648 \fB\-hide \fIboolean\fR
649 Indicates whether the axis is displayed.
650 .TP
651 \fB\-justify \fIjustify\fR
652 Specifies how the axis title should be justified. This matters only
653 when the axis title contains more than one line of text. \fIJustify\fR
654 must be \fBleft\fR, \fBright\fR, or \fBcenter\fR. The default is
655 \fBcenter\fR.
656 .TP
657 \fB\-limits \fIformatStr\fR
658 Specifies a printf-like description to format the minimum and maximum
659 limits of the axis. The limits are displayed at the top/bottom or
660 left/right sides of the plotting area. \fIFormatStr\fR is a list of
661 one or two format descriptions. If one description is supplied, both
662 the minimum and maximum limits are formatted in the same way. If two,
663 the first designates the format for the minimum limit, the second for
664 the maximum. If \fB""\fR is given as either description, then
665 the that limit will not be displayed. The default is \fB""\fR.
666 .TP
667 \fB\-linewidth \fIpixels\fR
668 Sets the width of the axis and tick lines. The default is \fB1\fR
669 pixel.
670 .TP
671 \fB\-logscale \fIboolean\fR
672 Indicates whether the scale of the axis is logarithmic or linear. If
673 \fIboolean\fR is true, the axis is logarithmic. The default scale is
674 linear.
675 .TP
676 \fB\-loose \fIboolean\fR
677 Indicates whether the limits of the axis should fit the data points tightly,
678 at the outermost data points, or loosely, at the outer tick intervals.
679 This is relevant only when the axis limit is automatically calculated.
680 If \fIboolean\fR is true, the axis range is "loose".
681 The default is \fB0\fR.
682 .TP
683 \fB\-majorticks \fImajorList\fR
684 Specifies where to display major axis ticks. You can use this option
685 to display ticks at non-uniform intervals. \fIMajorList\fR is a list
686 of axis coordinates designating the location of major ticks. No
687 minor ticks are drawn. If \fImajorList\fR is \fB""\fR,
688 major ticks will be automatically computed. The default is \fB""\fR.
689 .TP
690 \fB\-max \fIvalue\fR
691 Sets the maximum limit of \fIaxisName\fR. Any data point greater
692 than \fIvalue\fR is not displayed. If \fIvalue\fR is \fB""\fR,
693 the maximum limit is calculated using the largest data value.
694 The default is \fB""\fR.
695 .TP
696 \fB\-min \fIvalue\fR
697 Sets the minimum limit of \fIaxisName\fR. Any data point less than
698 \fIvalue\fR is not displayed. If \fIvalue\fR is \fB""\fR,
699 the minimum limit is calculated using the smallest data value.
700 The default is \fB""\fR.
701 .TP
702 \fB\-minorticks \fIminorList\fR
703 Specifies where to display minor axis ticks. You can use this option
704 to display minor ticks at non-uniform intervals. \fIMinorList\fR is a
705 list of real values, ranging from 0.0 to 1.0, designating the placement of
706 a minor tick. No minor ticks are drawn if the \fB\-majortick\fR
707 option is also set. If \fIminorList\fR is \fB""\fR, minor ticks will
708 be automatically computed. The default is \fB""\fR.
709 .TP
710 \fB\-rotate \fItheta\fR
711 Specifies the how many degrees to rotate the axis tick labels.
712 \fITheta\fR is a real value representing the number of degrees
713 to rotate the tick labels. The default is \fB0.0\fR degrees.
714 .TP
715 \fB\-shiftby \fIvalue\fR
716 Specifies how much to automatically shift the range of the axis.
717 When the new data exceeds the current axis maximum, the maximum
718 is increased in increments of \fIvalue\fR. You can use this
719 option to prevent the axis limits from being recomputed
720 at each new time point. If \fIvalue\fR is 0.0, then no automatic
721 shifting is done. The default is \fB0.0\fR.
722 .TP
723 \fB\-showticks \fIboolean\fR
724 Indicates whether axis ticks should be drawn. If \fIboolean\fR is
725 true, ticks are drawn. If false, only the
726 axis line is drawn. The default is \fB1\fR.
727 .TP
728 \fB\-stepsize \fIvalue\fR
729 Specifies the interval between major axis ticks. If \fIvalue\fR isn't
730 a valid interval (must be less than the axis range),
731 the request is ignored and the step size is automatically calculated.
732 .TP
733 \fB\-subdivisions \fInumber\fR
734 Indicates how many minor axis ticks are
735 to be drawn. For example, if \fInumber\fR is two, only one minor
736 tick is drawn. If \fInumber\fR is one, no minor ticks are
737 displayed. The default is \fB2\fR.
738 .TP
739 \fB\-tickfont \fIfontName\fR
740 Specifies the font for axis tick labels. The default is
741 \fB*-Courier-Bold-R-Normal-*-100-*\fR.
742 .TP
743 \fB\-ticklength \fIpixels\fR
744 Sets the length of major and minor ticks (minor ticks are half the
745 length of major ticks). If \fIpixels\fR is less than zero, the axis
746 will be inverted with ticks drawn pointing towards the plot. The
747 default is \fB0.1i\fR.
748 .TP
749 \fB\-title \fItext\fR
750 Sets the title of the axis. If \fItext\fR is
751 \fB""\fR, no axis title will be displayed.
752 .TP
753 \fB\-titlecolor \fIcolor\fR
754 Sets the color of the axis title. The default is \fBblack\fR.
755 .TP
756 \fB\-titlefont \fIfontName\fR
757 Specifies the font for axis title. The default is
758 \fB*-Helvetica-Bold-R-Normal-*-14-140-*\fR.
759 .PP
760 Axis configuration options may be also be set by the \fBoption\fR
761 command. The resource class is \fBAxis\fR. The resource names
762 are the names of the axes (such as \fBx\fR or \fBx2\fR).
763 .CS
764 option add *Stripchart.Axis.Color blue
765 option add *Stripchart.x.LogScale true
766 option add *Stripchart.x2.LogScale false
767 .CE
768 .RE
769 .TP
770 \fIpathName \fBaxis \fBcreate \fIaxisName \fR?\fIoption value\fR?...
771 Creates a new axis by the name \fIaxisName\fR. No axis by the same
772 name can already exist. \fIOption\fR and \fIvalue\fR are described
773 in above in the axis \fBconfigure\fR operation.
774 .TP
775 \fIpathName \fBaxis \fBdelete \fR?\fIaxisName\fR?...
776 Deletes the named axes. An axis is not really
777 deleted until it is not longer in use, so it's safe to delete
778 axes mapped to elements.
779 .TP
780 \fIpathName \fBaxis invtransform \fIaxisName value\fR
781 Performs the inverse transformation, changing the screen coordinate
782 \fIvalue\fR to a graph coordinate, mapping the value mapped to
783 \fIaxisName\fR. Returns the graph coordinate.
784 .TP
785 \fIpathName \fBaxis limits \fIaxisName\fR
786 Returns a list of the minimum and maximum limits for \fIaxisName\fR. The order
787 of the list is \fBmin max\fR.
788 .TP
789 \fIpathName \fBaxis names \fR?\fIpattern\fR?...
790 Returns a list of axes matching zero or more patterns. If no
791 \fIpattern\fR argument is give, the names of all axes are returned.
792 .TP
793 \fIpathName \fBaxis transform \fIaxisName value\fR
794 Transforms the coordinate \fIvalue\fR to a screen coordinate by mapping
795 the it to \fIaxisName\fR. Returns the transformed screen coordinate.
796 .PP
797 Only four axes can be displayed simultaneously. By default, they are
798 \fBx\fR, \fBy\fR, \fBx2\fR, and \fBy2\fR. You can swap in a different
799 axis with \fBuse\fR operation of the special axis components:
800 \fBxaxis\fR, \fBx2axis\fR, \fByaxis\fR, and \fBy2axis\fR.
801 .CS
802 \&.g create axis temp
803 \&.g create axis time
804 \&...
805 \&.g xaxis use temp
806 \&.g yaxis use time
807 .CE
808 Only the axes specified for use are displayed on the screen.
809 .PP
810 The \fBxaxis\fR, \fBx2axis\fR, \fByaxis\fR, and \fBy2axis\fR
811 components operate on an axis location rather than a specific axis
812 like the more general \fBaxis\fR component does. The \fBxaxis\fR
813 component manages the X-axis located in the bottom margin (whatever
814 axis that happens to be). Likewise, \fByaxis\fR uses the Y-axis in
815 the left margin, \fBx2axis\fR the top X-axis, and \fBy2axis\fR the
816 right Y-axis.
817 .PP
818 They implicitly control the axis that is currently using to that
819 location. By default, \fBxaxis\fR uses the \fBx\fR axis, \fByaxis\fR
820 uses \fBy\fR, \fBx2axis\fR uses \fBx2\fR, and \fBy2axis\fR uses
821 \fBy2\fR. These components can be more convenient to use than always
822 determining what axes are current being displayed by the graph.
823 .PP
824 The following operations are available for axes. They mirror exactly
825 the operations of the \fBaxis\fR component. The \fIaxis\fR argument
826 must be \fBxaxis\fR, \fBx2axis\fR, \fByaxis\fR, or \fBy2axis\fR.
827 .TP
828 \fIpathName \fIaxis \fBcget \fIoption\fR
829 .TP
830 \fIpathName \fIaxis \fBconfigure \fR?\fIoption value\fR?...
831 .TP
832 \fIpathName \fIaxis\fB invtransform \fIvalue\fR
833 .TP
834 \fIpathName \fIaxis \fBlimits\fR
835 .TP
836 \fIpathName \fIaxis\fB transform \fIvalue\fR
837 .TP
838 \fIpathName \fIaxis\fB use \fR?\fIaxisName\fR?
839 Designates the axis \fIaxisName\fR is to be displayed at this
840 location. \fIAxisName\fR can not be already in use at another location.
841 This command returns the name of the axis currently using this location.
842 .SS "CROSSHAIRS COMPONENT"
843 Cross hairs consist of two intersecting lines (one vertical and one horizontal)
844 drawn completely across the plotting area. They are used to position
845 the mouse in relation to the coordinate axes. Cross hairs differ from line
846 markers in that they are implemented using XOR drawing primitives.
847 This means that they can be quickly drawn and erased without redrawing
848 the entire strip chart.
849 .PP
850 The following operations are available for cross hairs:
851 .TP
852 \fIpathName \fBcrosshairs cget \fIoption\fR
853 Returns the current value of the cross hairs configuration option
854 given by \fIoption\fR. \fIOption\fR may be any option
855 described below for the cross hairs \fBconfigure\fR operation.
856 .TP
857 \fIpathName \fBcrosshairs configure \fR?\fIoption value\fR?...
858 Queries or modifies the configuration options of the cross hairs. If
859 \fIoption\fR isn't specified, a list describing all the current
860 options for the cross hairs is returned. If \fIoption\fR is specified,
861 but not \fIvalue\fR, then a list describing \fIoption\fR is returned.
862 If one or more \fIoption\fR and \fIvalue\fR pairs are specified, then
863 for each pair, the cross hairs option \fIoption\fR is set to
864 \fIvalue\fR.
865 The following options are available for cross hairs.
866 .RS
867 .TP
868 \fB\-color \fIcolor\fR
869 Sets the color of the cross hairs. The default is \fBblack\fR.
870 .TP
871 \fB\-dashes \fIdashList\fR
872 Sets the dash style of the cross hairs. \fIDashList\fR is a list of up
873 to 11 numbers that alternately represent the lengths of the dashes
874 and gaps on the cross hair lines. Each number must be between 1 and
875 255. If \fIdashList\fR is \fB""\fR, the cross hairs will be solid
876 lines.
877 .TP
878 \fB\-hide \fIboolean\fR
879 Indicates whether cross hairs are drawn. If \fIboolean\fR is true,
880 cross hairs are not drawn. The default is \fByes\fR.
881 .TP
882 \fB\-linewidth \fIpixels\fR
883 Set the width of the cross hair lines. The default is \fB1\fR.
884 .TP
885 \fB\-position \fIpos\fR
886 Specifies the screen position where the cross hairs intersect.
887 \fIPos\fR must be in the form "\fI@x,y\fR", where \fIx\fR and \fIy\fR
888 are the window coordinates of the intersection.
889 .PP
890 Cross hairs configuration options may be also be set by the
891 \fBoption\fR command. The resource name and class are
892 \fBcrosshairs\fR and \fBCrosshairs\fR respectively.
893 .CS
894 option add *Stripchart.Crosshairs.LineWidth 2
895 option add *Stripchart.Crosshairs.Color red
896 .CE
897 .RE
898 .TP
899 \fIpathName \fBcrosshairs off\fR
900 Turns of the cross hairs.
901 .TP
902 \fIpathName \fBcrosshairs on\fR
903 Turns on the display of the cross hairs.
904 .TP
905 \fIpathName \fBcrosshairs toggle\fR
906 Toggles the current state of the cross hairs, alternately mapping and
907 unmapping the cross hairs.
908 .SS "ELEMENT COMPONENTS"
909 A data element represents a set of data. It contains x and y vectors
910 containing the coordinates of the data points. Elements can be
911 displayed with a symbol at each data point and lines connecting the
912 points. Elements also control the appearance of the data, such as the
913 symbol type, line width, color etc.
914 .PP
915 When new data elements are created, they are automatically added to a
916 list of displayed elements. The display list controls what elements
917 are drawn and in what order.
918 .PP
919 The following operations are available for elements.
920 .TP
921 \fIpathName \fBelement activate \fIelemName \fR?\fIindex\fR?...
922 Specifies the data points of element \fIelemName\fR to be drawn
923 using active foreground and background colors. \fIElemName\fR is the
924 name of the element and \fIindex\fR is a number representing the index
925 of the data point. If no indices are present then all data points
926 become active.
927 .TP
928 \fIpathName \fBelement cget \fIelemName \fIoption\fR
929 Returns the current value of the element configuration option given by
930 \fIoption\fR. \fIOption\fR may be any option described below
931 for the element \fBconfigure\fR operation.
932 .TP
933 \fIpathName \fBelement closest \fIx y\fR \fIvarName\fR ?\fIoption value\fR?... ?\fIelemName\fR?...
934 Finds the data point closest to the window coordinates \fIx\fR and
935 \fIy\fR in the element \fIelemName\fR. \fIElemName\fR is the name of
936 an element, that must not be hidden. If no elements are specified,
937 then all visible elements are searched. It returns via the array
938 variable \fIvarName\fR the name of the closest element, the index of
939 its closest point, and the graph coordinates of the point. Returns
940 \fB0\fR, if no data point within the threshold distance can be found,
941 otherwise \fB1\fR is returned. The following
942 \fIoption\fR\-\fIvalue\fR pairs are available.
943 .RS
944 .TP
945 \fB\-halo \fIpixels\fR
946 Specifies a threshold distance where selected data points are ignored.
947 \fIPixels\fR is a valid screen distance, such as \fB2\fR or \fB1.2i\fR.
948 If this option isn't specified, then it defaults to the value of the
949 stripchart's \fB\-halo\fR option.
950 .TP
951 \fB\-interpolate \fIboolean\fR
952 Indicates that both the data points and interpolated points along
953 the line segment formed should be considered. If \fIboolean\fR
954 is true, the closest line segment will be selected instead of the
955 closest point. If this option isn't specified, \fIboolean\fR defaults
956 to \fB0\fR.
957 .RE
958 .TP
959 \fIpathName \fBelement configure \fIelemName \fR?\fIoption value\fR?...
960 Queries or modifies the configuration options for elements. If
961 \fIoption\fR isn't specified, a list describing all the current
962 options for \fIelemName\fR is returned. If \fIoption\fR is specified,
963 but not \fIvalue\fR, then a list describing the option \fIoption\fR is
964 returned. If one or more \fIoption\fR and \fIvalue\fR pairs are
965 specified, then for each pair, the element option \fIoption\fR is set
966 to \fIvalue\fR. The following options are valid for elements.
967 .RS
968 .TP
969 \fB\-activepen \fIpenName\fR
970 Specifies pen to use to draw active element. If \fIpenName\fR is
971 \fB""\fR, no active elements will be drawn. The default is
972 \fBactiveLine\fR.
973 .TP
974 \fB\-color \fIcolor\fR
975 Sets the color of the traces connecting the data points.
976 .TP
977 \fB\-dashes \fIdashList\fR
978 Sets the dash style of element line. \fIDashList\fR is a list of up to
979 11 numbers that alternately represent the lengths of the dashes and
980 gaps on the element line. Each number must be between 1 and 255. If
981 \fIdashList\fR is \fB""\fR, the lines will be solid.
982 .TP
983 \fB\-data \fIcoordList\fR
984 Specifies the X\-Y coordinates of the data. \fICoordList\fR is a
985 list of numeric expressions representing the X\-Y coordinate pairs
986 of each data point.
987 .TP
988 \fB\-fill \fIcolor\fR
989 Sets the interior color of symbols. If \fIcolor\fR is \fB""\fR, then
990 the interior of the symbol is transparent. If \fIcolor\fR is
991 \fBdefcolor\fR, then the color will be the same as the \fB\-color\fR
992 option. The default is \fBdefcolor\fR.
993 .TP
994 \fB\-hide \fIboolean\fR
995 Indicates whether the element is displayed. The default is \fBno\fR.
996 .TP
997 \fB\-label \fItext\fR
998 Sets the element's label in the legend. If \fItext\fR
999 is \fB""\fR, the element will have no entry in the legend.
1000 The default label is the element's name.
1001 .TP
1002 \fB\-linewidth \fIpixels\fR
1003 Sets the width of the connecting lines between data points. If
1004 \fIpixels\fR is \fB0\fR, no connecting lines will be drawn between
1005 symbols. The default is \fB0\fR.
1006 .TP
1007 \fB\-mapx \fIxAxis\fR
1008 Selects the X\-axis to map the element's X\-coordinates onto.
1009 \fIXAxis\fR must be the name of an axis. The default is \fBx\fR.
1010 .TP
1011 \fB\-mapy \fIyAxis\fR
1012 Selects the Y\-axis to map the element's Y\-coordinates onto.
1013 \fIYAxis\fR must be the name of an axis. The default is \fBy\fR.
1014 .TP
1015 \fB\-offdash \fIcolor\fR
1016 Sets the color of the stripes when traces are dashed (see the
1017 \fB\-dashes\fR option). If \fIcolor\fR is \fB""\fR, then the "off"
1018 pixels will represent gaps instead of stripes. If \fIcolor\fR is
1019 \fBdefcolor\fR, then the color will be the same as the \fB\-color\fR
1020 option. The default is \fBdefcolor\fR.
1021 .TP
1022 \fB\-outline \fIcolor\fR
1023 Sets the color or the outline around each symbol. If \fIcolor\fR is
1024 \fB""\fR, then no outline is drawn. If \fIcolor\fR is \fBdefcolor\fR,
1025 then the color will be the same as the \fB\-color\fR option. The
1026 default is \fBdefcolor\fR.
1027 .TP
1028 \fB\-outlinewidth \fIpixels\fR
1029 Sets the width of the outline bordering each symbol. If \fIpixels\fR
1030 is \fB0\fR, no outline will be drawn. The default is \fB1\fR.
1031 .TP
1032 \fB\-pixels \fIpixels\fR
1033 Sets the size of symbols. If \fIpixels\fR is \fB0\fR, no symbols will
1034 be drawn. The default is \fB0.125i\fR.
1035 .TP
1036 \fB\-scalesymbols \fIboolean\fR
1037 If \fIboolean\fR is true, the size of the symbols
1038 drawn for \fIelemName\fR will change with scale of the X\-axis and Y\-axis.
1039 At the time this option is set, the current ranges of the axes are
1040 saved as the normalized scales (i.e scale factor is 1.0) and the
1041 element is drawn at its designated size (see the \fB\-pixels\fR
1042 option). As the scale of the axes change, the symbol will be scaled
1043 according to the smaller of the X\-axis and Y\-axis scales. If \fIboolean\fR
1044 is false, the element's symbols are drawn at the designated size,
1045 regardless of axis scales. The default is \fB0\fR.
1046 .TP
1047 \fB\-smooth \fIsmooth\fR
1048 Specifies how connecting line segments are drawn between data points.
1049 \fISmooth\fR can be either \fBlinear\fR, \fBstep\fR, \fBnatural\fR, or
1050 \fBquadratic\fR. If \fIsmooth\fR is \fBlinear\fR, a single line
1051 segment is drawn, connecting both data points. When \fIsmooth\fR is
1052 \fBstep\fR, two line segments are drawn. The first is a horizontal
1053 line segment which steps the next x-coordinate. The second is a
1054 vertical line, moving to the next y-coordinate. Both \fInatural\fR and
1055 \fIquadratic\fR generate multiple segments between data points. If
1056 \fInatural\fR, the segments are generated using a cubic spline. If
1057 \fIquadratic\fR, a quadratic spline is used. The default is
1058 \fIlinear\fR.
1059 .TP
1060 \fB\-styles \fIstyleList\fR
1061 Specifies what pen to use based upon the range of weights given.
1062 \fIStyleList\fR is a list of style specifications. Each style
1063 specification, in turn, is a list consisting of a pen name, and
1064 optionally a minimum and maximum range. Data points whose weight (see
1065 the \fB\-weight\fR option) falls in this range, are drawn with this
1066 pen. If no range is specified it defaults to the number of the pen in
1067 the list.
1068 .TP
1069 \fB\-symbol \fIsymbol\fR
1070 Specifies the symbol for data points. \fISymbol\fR can be either
1071 \fBsquare\fR, \fBcircle\fR, \fBdiamond\fR, \fBplus\fR, \fBcross\fR,
1072 \fBsplus\fR, \fBscross\fR, \fBtriangle\fR, \fB""\fR (where no symbol
1073 is drawn), or a bitmap. Bitmaps are specified as "\fIsource\fR
1074 ?\fImask\fR?", where \fIsource\fR is the name of the bitmap, and
1075 \fImask\fR is the bitmap's optional mask. The default is
1076 \fBcircle\fR.
1077 .TP
1078 \fB\-weights \fIwVec\fR
1079 Specifies the weights of the individual data points. This, in
1080 conjunction with the list pen styles (see the \fB\-styles\fR option)
1081 controls how data points are drawn. \fIWVec\fR is the name of a BLT
1082 vector or a list of numeric expressions representing the weights for
1083 each data point.
1084 .TP
1085 \fB\-xdata \fIxVec\fR
1086 Specifies the x-coordinates of the data. \fIXVec\fR is the name of
1087 a BLT vector or a list of numeric expressions.
1088 .TP
1089 \fB\-ydata \fIyVec\fR
1090 Specifies the y-coordinates of the data. \fIYVec\fR is the name of
1091 a BLT vector or a list of numeric expressions.
1092 .PP
1093 Element configuration options may also be set by the \fBoption\fR
1094 command. The resource class is \fBElement\fR. The resource name is
1095 the name of the element.
1096 .CS
1097 option add *Stripchart.Element.symbol line
1098 option add *Stripchart.e1.symbol line
1099 .CE
1100 .RE
1101 .TP
1102 \fIpathName \fBelement create \fIelemName\fR ?\fIoption value\fR?...
1103 Creates a new element \fIelemName\fR. It's an error is
1104 an element \fIelemName\fR already exists. If
1105 additional arguments are present, they specify options valid for
1106 element \fBconfigure\fR operation.
1107 .TP
1108 \fIpathName \fBelement deactivate \fIelemName\fR ?\fIelemName\fR?...
1109 Deactivates all the elements matching \fIpattern\fR.
1110 Elements whose names match any of the patterns given are redrawn using
1111 their normal colors.
1112 .TP
1113 \fIpathName \fBelement delete\fR ?\fIelemName\fR?...
1114 Deletes all the named elements. The graph is automatically redrawn.
1115 .TP
1116 \fIpathName \fBelement exists \fIelemName\fR
1117 Returns \fB1\fR if an element \fIelemName\fR currently exists and \fB0\fR otherwise.
1118 .TP
1119 \fIpathName \fBelement names \fR?\fIpattern\fR?...
1120 Returns the elements matching one or more pattern. If no
1121 \fIpattern\fR is given, the names of all elements is returned.
1122 .TP
1123 \fIpathName \fBelement show\fR ?\fInameList\fR?
1124 Queries or modifies the element display list. The element display
1125 list designates the elements drawn and in what
1126 order. \fINameList\fR is a list of elements to be displayed in the
1127 order they are named. If there is no \fInameList\fR argument,
1128 the current display list is returned.
1129 .TP
1130 \fIpathName \fBelement type\fR \fIelemName\fR
1131 Returns the type of \fIelemName\fR.
1132 If the element is a bar element, the commands returns the string
1133 \fB"bar"\fR, otherwise it returns \fB"line"\fR.
1134 .CE
1135 .SS "GRID COMPONENT"
1136 Grid lines extend from the major and minor ticks of each axis
1137 horizontally or vertically across the plotting area. The following
1138 operations are available for grid lines.
1139 .TP
1140 \fIpathName \fBgrid cget \fIoption\fR
1141 Returns the current value of the grid line configuration option given by
1142 \fIoption\fR. \fIOption\fR may be any option described below
1143 for the grid \fBconfigure\fR operation.
1144 .TP
1145 \fIpathName \fBgrid configure\fR ?\fIoption value\fR?...
1146 Queries or modifies the configuration options for grid lines. If
1147 \fIoption\fR isn't specified, a list describing all the current
1148 grid options for \fIpathName\fR is returned. If \fIoption\fR is specified,
1149 but not \fIvalue\fR, then a list describing \fIoption\fR is
1150 returned. If one or more \fIoption\fR and \fIvalue\fR pairs are
1151 specified, then for each pair, the grid line option \fIoption\fR is set to
1152 \fIvalue\fR. The following options are valid for grid lines.
1153 .RS
1154 .TP
1155 \fB\-color \fIcolor\fR
1156 Sets the color of the grid lines. The default is \fBblack\fR.
1157 .TP
1158 \fB\-dashes \fIdashList\fR
1159 Sets the dash style of the grid lines. \fIDashList\fR is a list of up
1160 to 11 numbers that alternately represent the lengths of the dashes
1161 and gaps on the grid lines. Each number must be between 1 and 255.
1162 If \fIdashList\fR is \fB""\fR, the grid will be solid lines.
1163 .TP
1164 \fB\-hide \fIboolean\fR
1165 Indicates whether the grid should be drawn. If \fIboolean\fR
1166 is true, grid lines are not shown. The default is \fByes\fR.
1167 .TP
1168 \fB\-linewidth \fIpixels\fR
1169 Sets the width of grid lines. The default width is \fB1\fR.
1170 .TP
1171 \fB\-mapx \fIxAxis\fR
1172 Specifies the X\-axis to display grid lines. \fIXAxis\fR
1173 must be the name of an axis. The default is \fBx\fR.
1174 .TP
1175 \fB\-mapy \fIyAxis\fR
1176 Specifies the Y\-axis to display grid lines. \fIYAxis\fR
1177 must be the name of an axis. The default is \fBy\fR.
1178 .TP
1179 \fB\-minor \fIboolean\fR
1180 Indicates whether the grid lines should be drawn for minor ticks.
1181 If \fIboolean\fR is true, the lines will appear at
1182 minor tick intervals. The default is \fB1\fR.
1183 .PP
1184 Grid configuration options may also be set by the
1185 \fBoption\fR command. The resource name and class are \fBgrid\fR and
1186 \fBGrid\fR respectively.
1187 .CS
1188 option add *Stripchart.grid.LineWidth 2
1189 option add *Stripchart.Grid.Color black
1190 .CE
1191 .RE
1192 .TP
1193 \fIpathName \fBgrid off\fR
1194 Turns off the display the grid lines.
1195 .TP
1196 \fIpathName \fBgrid on\fR
1197 Turns on the display the grid lines.
1198 .TP
1199 \fIpathName \fBgrid toggle\fR
1200 Toggles the display of the grid.
1201 .SS "LEGEND COMPONENT"
1202 The legend displays a list of the data elements. Each entry consists
1203 of the element's symbol and label. The legend can appear in any
1204 margin (the default location is in the right margin). It
1205 can also be positioned anywhere within the plotting area.
1206 .PP
1207 The following operations are valid for the legend.
1208 .TP
1209 \fIpathName \fBlegend activate \fIpattern\fR...
1210 Selects legend entries to be drawn using the active legend colors and relief.
1211 All entries whose element names match \fIpattern\fR are selected. To
1212 be selected, the element name must match only one \fIpattern\fR.
1213 .TP
1214 \fIpathName \fBlegend cget \fIoption\fR
1215 Returns the current value of a legend configuration option.
1216 \fIOption\fR may be any option described below in the
1217 legend \fBconfigure\fR operation.
1218 .TP
1219 \fIpathName \fBlegend configure \fR?\fIoption value\fR?...
1220 Queries or modifies the configuration options for the legend. If
1221 \fIoption\fR isn't specified, a list describing the current
1222 legend options for \fIpathName\fR is returned. If \fIoption\fR is
1223 specified, but not \fIvalue\fR, then a list describing \fIoption\fR is
1224 returned. If one or more \fIoption\fR and \fIvalue\fR pairs are
1225 specified, then for each pair, the legend option \fIoption\fR is set
1226 to \fIvalue\fR. The following options are valid for the legend.
1227 .RS
1228 .TP
1229 \fB\-activebackground \fIcolor\fR
1230 Sets the background color for active legend entries. All legend
1231 entries marked active (see the legend \fBactivate\fR operation) are
1232 drawn using this background color.
1233 .TP
1234 \fB\-activeborderwidth \fIpixels\fR
1235 Sets the width of the 3-D border around the outside edge of the active legend
1236 entries. The default is \fB2\fR.
1237 .TP
1238 \fB\-activeforeground \fIcolor\fR
1239 Sets the foreground color for active legend entries. All legend
1240 entries marked as active (see the legend \fBactivate\fR operation) are
1241 drawn using this foreground color.
1242 .TP
1243 \fB\-activerelief \fIrelief\fR
1244 Specifies the 3-D effect desired for active legend entries.
1245 \fIRelief\fR denotes how the interior of the entry should appear
1246 relative to the legend; for example, \fBraised\fR means the entry
1247 should appear to protrude from the legend, relative to the surface of
1248 the legend. The default is \fBflat\fR.
1249 .TP
1250 \fB\-anchor \fIanchor\fR
1251 Tells how to position the legend relative to the positioning point for
1252 the legend. This is dependent on the value of the \fB\-position\fR
1253 option. The default is \fBcenter\fR.
1254 .RS
1255 .TP 1.25i
1256 \fBleft\fR or \fBright\fR
1257 The anchor describes how to position the legend vertically.
1258 .TP
1259 \fBtop\fR or \fBbottom\fR
1260 The anchor describes how to position the legend horizontally.
1261 .TP
1262 \fB@x,y\fR
1263 The anchor specifies how to position the legend relative to the
1264 positioning point. For example, if \fIanchor\fR is \fBcenter\fR then
1265 the legend is centered on the point; if \fIanchor\fR is \fBn\fR then
1266 the legend will be drawn such that the top center point of the
1267 rectangular region occupied by the legend will be at the positioning
1268 point.
1269 .TP
1270 \fBplotarea\fR
1271 The anchor specifies how to position the legend relative to the
1272 plotting area. For example, if \fIanchor\fR is \fBcenter\fR then the
1273 legend is centered in the plotting area; if \fIanchor\fR is \fBne\fR
1274 then the legend will be drawn such that occupies the upper right
1275 corner of the plotting area.
1276 .RE
1277 .TP
1278 \fB\-background \fIcolor\fR
1279 Sets the background color of the legend. If \fIcolor\fR is \fB""\fR,
1280 the legend background with be transparent.
1281 .TP
1282 \fB\-borderwidth \fIpixels\fR
1283 Sets the width of the 3-D border around the outside edge of the legend (if
1284 such border is being drawn; the \fBrelief\fR option determines this).
1285 The default is \fB2\fR pixels.
1286 .TP
1287 \fB\-font \fIfontName\fR
1288 \fIFontName\fR specifies a font to use when drawing the labels of each
1289 element into the legend. The default is
1290 \fB*-Helvetica-Bold-R-Normal-*-12-120-*\fR.
1291 .TP
1292 \fB\-foreground \fIcolor\fR
1293 Sets the foreground color of the text drawn for the element's label.
1294 The default is \fBblack\fR.
1295 .TP
1296 \fB\-hide \fIboolean\fR
1297 Indicates whether the legend should be displayed. If \fIboolean\fR is
1298 true, the legend will not be draw. The default is \fBno\fR.
1299 .TP
1300 \fB\-ipadx \fIpad\fR
1301 Sets the amount of internal padding to be added to the width of each
1302 legend entry. \fIPad\fR can be a list of one or two screen distances. If
1303 \fIpad\fR has two elements, the left side of the legend entry is
1304 padded by the first distance and the right side by the second. If
1305 \fIpad\fR is just one distance, both the left and right sides are padded
1306 evenly. The default is \fB2\fR.
1307 .TP
1308 \fB\-ipady \fIpad\fR
1309 Sets an amount of internal padding to be added to the height of each
1310 legend entry. \fIPad\fR can be a list of one or two screen distances. If
1311 \fIpad\fR has two elements, the top of the entry is padded by the
1312 first distance and the bottom by the second. If \fIpad\fR is just
1313 one distance, both the top and bottom of the entry are padded evenly.
1314 The default is \fB2\fR.
1315 .TP
1316 \fB\-padx \fIpad\fR
1317 Sets the padding to the left and right exteriors of the legend.
1318 \fIPad\fR can be a list of one or two screen distances. If \fIpad\fR
1319 has two elements, the left side of the legend is padded by the first
1320 distance and the right side by the second. If \fIpad\fR has just one
1321 distance, both the left and right sides are padded evenly. The
1322 default is \fB4\fR.
1323 .TP
1324 \fB\-pady \fIpad\fR
1325 Sets the padding above and below the legend. \fIPad\fR can be a list
1326 of one or two screen distances. If \fIpad\fR has two elements, the area above
1327 the legend is padded by the first distance and the area below by the
1328 second. If \fIpad\fR is just one distance, both the top and
1329 bottom areas are padded evenly. The default is \fB0\fR.
1330 .TP
1331 \fB\-position \fIpos\fR
1332 Specifies where the legend is drawn. The
1333 \fB\-anchor\fR option also affects where the legend is positioned. If
1334 \fIpos\fR is \fBleft\fR, \fBleft\fR, \fBtop\fR, or \fBbottom\fR, the
1335 legend is drawn in the specified margin. If \fIpos\fR is
1336 \fBplotarea\fR, then the legend is drawn inside the plotting area at a
1337 particular anchor. If \fIpos\fR is in the form "\fI@x,y\fR", where
1338 \fIx\fR and \fIy\fR are the window coordinates, the legend is drawn in
1339 the plotting area at the specified coordinates. The default is
1340 \fBright\fR.
1341 .TP
1342 \fB\-raised \fIboolean\fR
1343 Indicates whether the legend is above or below the data elements. This
1344 matters only if the legend is in the plotting area. If \fIboolean\fR
1345 is true, the legend will be drawn on top of any elements that may
1346 overlap it. The default is \fBno\fR.
1347 .TP
1348 \fB\-relief \fIrelief\fR
1349 Specifies the 3-D effect for the border around the legend.
1350 \fIRelief\fR specifies how the interior of the legend should appear
1351 relative to the strip chart; for example, \fBraised\fR means the legend
1352 should appear to protrude from the strip chart, relative to the surface of
1353 the strip chart. The default is \fBsunken\fR.
1354 .PP
1355 Legend configuration options may also be set by the \fBoption\fR
1356 command. The resource name and class are \fBlegend\fR and
1357 \fBLegend\fR respectively.
1358 .CS
1359 option add *Stripchart.legend.Foreground blue
1360 option add *Stripchart.Legend.Relief raised
1361 .CE
1362 .RE
1363 .TP
1364 \fIpathName \fBlegend deactivate \fIpattern\fR...
1365 Selects legend entries to be drawn using the normal legend colors and
1366 relief. All entries whose element names match \fIpattern\fR are
1367 selected. To be selected, the element name must match only one
1368 \fIpattern\fR.
1369 .TP
1370 \fIpathName \fBlegend get \fIpos\fR
1371 Returns the name of the element whose entry is at the screen position
1372 \fIpos\fR in the legend. \fIPos\fR must be in the form "\fI@x,y\fR",
1373 where \fIx\fR and \fIy\fR are window coordinates. If the given
1374 coordinates do not lie over a legend entry, \fB""\fR is returned.
1375 .SS "PEN COMPONENTS"
1376 Pens define attributes (both symbol and line style) for elements.
1377 Pens mirror the configuration options of data elements that pertain to
1378 how symbols and lines are drawn. Data elements use pens to determine
1379 how they are drawn. A data element may use several pens at once. In
1380 this case, the pen used for a particular data point is determined from
1381 each element's weight vector (see the element's \fB\-weight\fR and
1382 \fB\-style\fR options).
1383 .PP
1384 One pen, called \fBactiveLine\fR, is automatically created.
1385 It's used as the default active pen for elements. So you can change
1386 the active attributes for all elements by simply reconfiguring this
1387 pen.
1388 .CS
1389 \&.s pen configure "activeLine" -color green
1390 .CE
1391 You can create and use any number of pens. To create a pen, invoke
1392 the pen component and its create operation.
1393 .CS
1394 \&.s pen create myPen
1395 .CE
1396 You map pens to a data element using either the element's
1397 \fB\-pen\fR or \fB\-activepen\fR options.
1398 .CS
1399 \&.s element create "line1" -xdata $x -ydata $tempData \\
1400 -pen myPen
1401 .CE
1402 An element can use several pens at once. This is done by specifying
1403 the name of the pen in the element's style list (see the
1404 \fB\-styles\fR option).
1405 .CS
1406 \&.s element configure "line1" -styles { myPen 2.0 3.0 }
1407 .CE
1408 This says that any data point with a weight between 2.0 and 3.0
1409 is to be drawn using the pen \fBmyPen\fR. All other points
1410 are drawn with the element's default attributes.
1411 .PP
1412 The following operations are available for pen components.
1413 .PP
1414 .TP
1415 \fIpathName \fBpen \fBcget \fIpenName \fIoption\fR
1416 Returns the current value of the option given by \fIoption\fR for
1417 \fIpenName\fR. \fIOption\fR may be any option described below
1418 for the pen \fBconfigure\fR operation.
1419 .TP
1420 \fIpathName \fBpen \fBconfigure \fIpenName \fR?\fIoption value\fR?...
1421 Queries or modifies the configuration options of \fIpenName\fR. If
1422 \fIoption\fR isn't specified, a list describing the current
1423 options for \fIpenName\fR is returned. If \fIoption\fR is specified, but
1424 not \fIvalue\fR, then a list describing \fIoption\fR is
1425 returned. If one or more \fIoption\fR and \fIvalue\fR pairs are
1426 specified, then for each pair, the pen option \fIoption\fR is set to
1427 \fIvalue\fR.
1428 The following options are valid for pens.
1429 .RS
1430 .TP
1431 \fB\-color \fIcolor\fR
1432 Sets the color of the traces connecting the data points.
1433 .TP
1434 \fB\-dashes \fIdashList\fR
1435 Sets the dash style of element line. \fIDashList\fR is a list of up to
1436 11 numbers that alternately represent the lengths of the dashes and
1437 gaps on the element line. Each number must be between 1 and 255. If
1438 \fIdashList\fR is \fB""\fR, the lines will be solid.
1439 .TP
1440 \fB\-fill \fIcolor\fR
1441 Sets the interior color of symbols. If \fIcolor\fR is \fB""\fR, then
1442 the interior of the symbol is transparent. If \fIcolor\fR is
1443 \fBdefcolor\fR, then the color will be the same as the \fB\-color\fR
1444 option. The default is \fBdefcolor\fR.
1445 .TP
1446 \fB\-linewidth \fIpixels\fR
1447 Sets the width of the connecting lines between data points. If
1448 \fIpixels\fR is \fB0\fR, no connecting lines will be drawn between
1449 symbols. The default is \fB0\fR.
1450 .TP
1451 \fB\-offdash \fIcolor\fR
1452 Sets the color of the stripes when traces are dashed (see the
1453 \fB\-dashes\fR option). If \fIcolor\fR is \fB""\fR, then the "off"
1454 pixels will represent gaps instead of stripes. If \fIcolor\fR is
1455 \fBdefcolor\fR, then the color will be the same as the \fB\-color\fR
1456 option. The default is \fBdefcolor\fR.
1457 .TP
1458 \fB\-outline \fIcolor\fR
1459 Sets the color or the outline around each symbol. If \fIcolor\fR is
1460 \fB""\fR, then no outline is drawn. If \fIcolor\fR is \fBdefcolor\fR,
1461 then the color will be the same as the \fB\-color\fR option. The
1462 default is \fBdefcolor\fR.
1463 .TP
1464 \fB\-outlinewidth \fIpixels\fR
1465 Sets the width of the outline bordering each symbol. If \fIpixels\fR
1466 is \fB0\fR, no outline will be drawn. The default is \fB1\fR.
1467 .TP
1468 \fB\-pixels \fIpixels\fR
1469 Sets the size of symbols. If \fIpixels\fR is \fB0\fR, no symbols will
1470 be drawn. The default is \fB0.125i\fR.
1471 .TP
1472 \fB\-symbol \fIsymbol\fR
1473 Specifies the symbol for data points. \fISymbol\fR can be either
1474 \fBsquare\fR, \fBcircle\fR, \fBdiamond\fR, \fBplus\fR, \fBcross\fR,
1475 \fBsplus\fR, \fBscross\fR, \fBtriangle\fR, \fB""\fR (where no symbol
1476 is drawn), or a bitmap. Bitmaps are specified as "\fIsource\fR
1477 ?\fImask\fR?", where \fIsource\fR is the name of the bitmap, and
1478 \fImask\fR is the bitmap's optional mask. The default is
1479 \fBcircle\fR.
1480 .TP
1481 \fB\-type \fIelemType\fR
1482 Specifies the type of element the pen is to be used with.
1483 This option should only be employed when creating the pen. This
1484 is for those that wish to mix different types of elements (bars and
1485 lines) on the same graph. The default type is "line".
1486 .PP
1487 Pen configuration options may be also be set by the \fBoption\fR
1488 command. The resource class is \fBPen\fR. The resource names
1489 are the names of the pens.
1490 .CS
1491 option add *Stripchart.Pen.Color blue
1492 option add *Stripchart.activeLine.color green
1493 .CE
1494 .RE
1495 .TP
1496 \fIpathName \fBpen \fBcreate \fIpenName \fR?\fIoption value\fR?...
1497 Creates a new pen by the name \fIpenName\fR. No pen by the same
1498 name can already exist. \fIOption\fR and \fIvalue\fR are described
1499 in above in the pen \fBconfigure\fR operation.
1500 .TP
1501 \fIpathName \fBpen \fBdelete \fR?\fIpenName\fR?...
1502 Deletes the named pens. A pen is not really
1503 deleted until it is not longer in use, so it's safe to delete
1504 pens mapped to elements.
1505 .TP
1506 \fIpathName \fBpen names \fR?\fIpattern\fR?...
1507 Returns a list of pens matching zero or more patterns. If no
1508 \fIpattern\fR argument is give, the names of all pens are returned.
1509 .SS "POSTSCRIPT COMPONENT"
1510 The strip chart can generate encapsulated PostScript output. There
1511 are several configuration options you can specify to control how the
1512 plot is generated. You can change the page dimensions and
1513 borders. The plot itself can be scaled, centered, or rotated to
1514 landscape. The PostScript output can be written directly to a file or
1515 returned through the interpreter.
1516 .PP
1517 The following postscript operations are available.
1518 .TP
1519 \fIpathName \fBpostscript cget \fIoption\fR
1520 Returns the current value of the postscript option given by
1521 \fIoption\fR. \fIOption\fR may be any option described
1522 below for the postscript \fBconfigure\fR operation.
1523 .TP
1524 \fIpathName \fBpostscript configure \fR?\fIoption value\fR?...
1525 Queries or modifies the configuration options for PostScript
1526 generation. If \fIoption\fR isn't specified, a list describing
1527 the current postscript options for \fIpathName\fR is returned. If
1528 \fIoption\fR is specified, but not \fIvalue\fR, then a list describing
1529 \fIoption\fR is returned. If one or more \fIoption\fR and \fIvalue\fR
1530 pairs are specified, then for each pair, the postscript option
1531 \fIoption\fR is set to \fIvalue\fR. The following postscript options
1532 are available.
1533 .RS
1534 .TP
1535 \fB\-center \fIboolean\fR
1536 Indicates whether the plot should be centered on the PostScript page. If
1537 \fIboolean\fR is false, the plot will be placed in the upper left
1538 corner of the page. The default is \fB1\fR.
1539 .TP
1540 \fB\-colormap \fIvarName\fR
1541 \fIVarName\fR must be the name of a global array variable that
1542 specifies a color mapping from the X color name to PostScript. Each
1543 element of \fIvarName\fR must consist of PostScript code to set a
1544 particular color value (e.g. ``\fB1.0 1.0 0.0 setrgbcolor\fR''). When
1545 outputting color information in PostScript, the array variable \fIvarName\fR
1546 is checked to see if an element of the name of the color exists. If so,
1547 it uses the value of the element as the PostScript
1548 command to set the color. If this option hasn't been specified, or if
1549 there isn't an entry in \fIvarName\fR for a given color, then it uses
1550 the red, green, and blue intensities from the X color.
1551 .TP
1552 \fB\-colormode \fImode\fR
1553 Specifies how to output color information. \fIMode\fR must be either
1554 \fBcolor\fR (for full color output), \fBgray\fR (convert all colors to
1555 their gray-scale equivalents) or \fBmono\fR (convert foreground colors
1556 to black and background colors to white). The default mode is
1557 \fBcolor\fR.
1558 .TP
1559 \fB\-fontmap \fIvarName\fR
1560 \fIVarName\fR must be the name of a global array variable that
1561 specifies a font mapping from the X font name to PostScript. Each
1562 element of \fIvarName\fR must consist of a Tcl list with one or two
1563 elements, which are the name and point size of a PostScript font.
1564 When outputting PostScript commands for a particular font, the
1565 array variable \fIvarName\fR is checked to see an element of the specified
1566 font exists. If there is such an element, then the font
1567 information contained in that element is used in the PostScript
1568 output. (If the point size is omitted from the list, the point size
1569 of the X font is used). Otherwise the X font is examined in an
1570 attempt to guess what PostScript font to use. This works only for
1571 fonts whose foundry property is \fIAdobe\fR (such as Times, Helvetica,
1572 Courier, etc.). If all of this fails then the font defaults to
1573 \fBHelvetica-Bold\fR.
1574 .TP
1575 \fB\-decorations \fIboolean\fR
1576 Indicates if PostScript commands to generate color backgrounds and 3-D
1577 borders should be output. If \fIboolean\fR is false, the background will
1578 be white and no 3-D borders will be generated. The
1579 default is \fB1\fR.
1580 .TP
1581 \fB\-height \fIpixels\fR
1582 Sets the height of the plot. This lets you plot the stripchart with a
1583 height different from the one displayed on the screen. If
1584 \fIpixels\fR is 0, the height is the same as the displayed height.
1585 The default is \fB0\fR.
1586 .TP
1587 \fB\-landscape \fIboolean\fR
1588 If \fIboolean\fR is true, this specifies the printed area is to be
1589 rotated 90 degrees. In non-rotated output the X-axis of the printed
1590 area runs along the short dimension of the page (``portrait''
1591 orientation); in rotated output the X-axis runs along the long
1592 dimension of the page (``landscape'' orientation). Defaults to
1593 \fB0\fR.
1594 .TP
1595 \fB\-maxpect \fIboolean\fR
1596 Indicates to scale the the plot so that it fills the PostScript page.
1597 The aspect ratio of the strip chart is still retained. The default is
1598 \fB0\fR.
1599 .TP
1600 \fB\-padx \fIpad\fR
1601 Sets the horizontal padding for the left and right page borders. The
1602 borders are exterior to the plot. \fIPad\fR can be a list of one or
1603 two screen distances. If \fIpad\fR has two elements, the left border is padded
1604 by the first distance and the right border by the second. If
1605 \fIpad\fR has just one distance, both the left and right borders are
1606 padded evenly. The default is \fB1i\fR.
1607 .TP
1608 \fB\-pady \fIpad\fR
1609 Sets the vertical padding for the top and bottom page borders. The
1610 borders are exterior to the plot. \fIPad\fR can be a list of one or
1611 two screen distances. If \fIpad\fR has two elements, the top border is padded
1612 by the first distance and the bottom border by the second. If
1613 \fIpad\fR has just one distance, both the top and bottom borders are
1614 padded evenly. The default is \fB1i\fR.
1615 .TP
1616 \fB\-paperheight \fIpixels\fR
1617 Sets the height of the postscript page. This can be used to select
1618 between different page sizes (letter, A4, etc). The default height is
1619 \fB11.0i\fR.
1620 .TP
1621 \fB\-paperwidth \fIpixels\fR
1622 Sets the width of the postscript page. This can be used to select
1623 between different page sizes (letter, A4, etc). The default width is
1624 \fB8.5i\fR.
1625 .TP
1626 \fB\-width \fIpixels\fR
1627 Sets the width of the plot. This lets you plot the strip chart with a
1628 width different from the one drawn on the screen. If \fIpixels\fR
1629 is 0, the width is the same as the widget's width. The default is
1630 \fB0\fR.
1631 .PP
1632 Postscript configuration options may be also be set by the
1633 \fBoption\fR command. The resource name and class are
1634 \fBpostscript\fR and \fBPostscript\fR respectively.
1635 .CS
1636 option add *Stripchart.postscript.Decorations false
1637 option add *Stripchart.Postscript.Landscape true
1638 .CE
1639 .RE
1640 .TP
1641 \fIpathName \fBpostscript output \fR?\fIfileName\fR? ?\fIoption value\fR?...
1642 Outputs a file of encapsulated PostScript. If a
1643 \fIfileName\fR argument isn't present, the command returns the
1644 PostScript. If any \fIoption-value\fR pairs are present, they set
1645 configuration options controlling how the PostScript is generated.
1646 \fIOption\fR and \fIvalue\fR can be anything accepted by the
1647 postscript \fBconfigure\fR operation above.
1648 .SS "MARKER COMPONENTS"
1649 Markers are simple drawing procedures used to annotate or highlight
1650 areas of the strip chart. Markers have various types: text strings,
1651 bitmaps, images, connected lines, windows, or polygons. They can be
1652 associated with a particular element, so that when the element is
1653 hidden or un-hidden, so is the marker. By default, markers are the
1654 last items drawn, so that data elements will appear in
1655 behind them. You can change this by configuring the \fB\-under\fR
1656 option.
1657 .PP
1658 Markers, in contrast to elements, don't affect the scaling of the
1659 coordinate axes. They can also have \fIelastic\fR coordinates
1660 (specified by \fB-Inf\fR and \fBInf\fR respectively) that translate
1661 into the minimum or maximum limit of the axis. For example, you can
1662 place a marker so it always remains in the lower left corner of the
1663 plotting area, by using the coordinates \fB-Inf\fR,\fB-Inf\fR.
1664 .PP
1665 The following operations are available for markers.
1666 .TP
1667 \fIpathName \fBmarker after \fImarkerId\fR ?\fIafterId\fR?
1668 Changes the order of the markers, drawing the first
1669 marker after the second. If no second \fIafterId\fR argument is
1670 specified, the marker is placed at the end of the display list. This
1671 command can be used to control how markers are displayed since markers
1672 are drawn in the order of this display list.
1673 .TP
1674 \fIpathName \fBmarker before \fImarkerId\fR ?\fIbeforeId\fR?
1675 Changes the order of the markers, drawing the first
1676 marker before the second. If no second \fIbeforeId\fR argument is
1677 specified, the marker is placed at the beginning of the display list.
1678 This command can be used to control how markers are displayed since
1679 markers are drawn in the order of this display list.
1680 .TP
1681 \fIpathName \fBmarker cget \fIoption\fR
1682 Returns the current value of the marker configuration option given by
1683 \fIoption\fR. \fIOption\fR may be any option described
1684 below in the \fBconfigure\fR operation.
1685 .TP
1686 \fIpathName \fBmarker configure \fImarkerId\fR ?\fIoption value\fR?...
1687 Queries or modifies the configuration options for markers. If
1688 \fIoption\fR isn't specified, a list describing the current
1689 options for \fImarkerId\fR is returned. If \fIoption\fR is specified,
1690 but not \fIvalue\fR, then a list describing \fIoption\fR is returned.
1691 If one or more \fIoption\fR and \fIvalue\fR pairs are specified, then
1692 for each pair, the marker option \fIoption\fR is set to \fIvalue\fR.
1693 .sp
1694 The following options are valid for all markers.
1695 Each type of marker also has its own type-specific options.
1696 They are described in the sections below.
1697 .RS
1698 .TP
1699 \fB\-coords \fIcoordList\fR
1700 Specifies the coordinates of the marker. \fICoordList\fR is
1701 a list of graph coordinates. The number of coordinates required
1702 is dependent on the type of marker. Text, image, and window markers
1703 need only two coordinates (an X\-Y coordinate). Bitmap markers
1704 can take either two or four coordinates (if four, they represent the
1705 corners of the bitmap). Line markers
1706 need at least four coordinates, polygons at least six.
1707 If \fIcoordList\fR is \fB""\fR, the marker will not be displayed.
1708 The default is \fB""\fR.
1709 .TP
1710 \fB\-element \fIelemName\fR
1711 Links the marker with the element \fIelemName\fR. The marker is
1712 drawn only if the element is also currently displayed (see the
1713 element's \fBshow\fR operation). If \fIelemName\fR is \fB""\fR, the
1714 marker is always drawn. The default is \fB""\fR.
1715 .TP
1716 \fB\-hide \fIboolean\fR
1717 Indicates whether the marker is drawn. If \fIboolean\fR is true,
1718 the marker is not drawn. The default is \fBno\fR.
1719 .TP
1720 \fB\-mapx \fIxAxis\fR
1721 Specifies the X\-axis to map the marker's X\-coordinates onto.
1722 \fIXAxis\fR must the name of an axis. The default is \fBx\fR.
1723 .TP
1724 \fB\-mapy \fIyAxis\fR
1725 Specifies the Y\-axis to map the marker's Y\-coordinates onto.
1726 \fIYAxis\fR must the name of an axis. The default is \fBy\fR.
1727 .TP
1728 \fB\-name \fImarkerId\fR
1729 Changes the identifier for the marker. The identifier \fImarkerId\fR
1730 can not already be used by another marker. If this option
1731 isn't specified, the marker's name is uniquely generated.
1732 .TP
1733 \fB\-under \fIboolean\fR
1734 Indicates whether the marker is drawn below/above data
1735 elements. If \fIboolean\fR is true, the marker is be drawn
1736 underneath the data element symbols and lines. Otherwise, the marker is
1737 drawn on top of the element. The default is \fB0\fR.
1738 .TP
1739 \fB\-xoffset \fIpixels\fR
1740 Specifies a screen distance to offset the marker horizontally.
1741 \fIPixels\fR is a valid screen distance, such as \fB2\fR or \fB1.2i\fR.
1742 The default is \fB0\fR.
1743 .TP
1744 \fB\-yoffset \fIpixels\fR
1745 Specifies a screen distance to offset the markers vertically.
1746 \fIPixels\fR is a valid screen distance, such as \fB2\fR or \fB1.2i\fR.
1747 The default is \fB0\fR.
1748 .PP
1749 Marker configuration options may also be set by the \fBoption\fR command.
1750 The resource class is either \fBBitmapMarker\fR, \fBImageMarker\fR,
1751 \fBLineMarker\fR, \fBPolygonMarker\fR, \fBTextMarker\fR, or \fBWindowMarker\fR,
1752 depending on the type of marker. The resource name is the name of the
1753 marker.
1754 .CS
1755 option add *Stripchart.TextMarker.Foreground white
1756 option add *Stripchart.BitmapMarker.Foreground white
1757 option add *Stripchart.m1.Background blue
1758 .CE
1759 .RE
1760 .TP
1761 \fIpathName \fBmarker create \fItype\fR ?\fIoption value\fR?...
1762 Creates a marker of the selected type. \fIType\fR may be either
1763 \fBtext\fR, \fBline\fR, \fBbitmap\fR, \fBimage\fR, \fBpolygon\fR, or
1764 \fBwindow\fR. This command returns the marker identifier,
1765 used as the \fImarkerId\fR argument in the other marker-related
1766 commands. If the \fB\-name\fR option is used, this overrides the
1767 normal marker identifier. If the name provided is already used for
1768 another marker, the new marker will replace the old.
1769 .TP
1770 \fIpathName \fBmarker delete\fR ?\fIname\fR?...
1771 Removes one of more markers. The graph will automatically be redrawn
1772 without the marker.\fR.
1773 .TP
1774 \fIpathName \fBmarker exists \fImarkerId\fR
1775 Returns \fB1\fR if the marker \fImarkerId\fR exists and \fB0\fR
1776 otherwise.
1777 .TP
1778 \fIpathName \fBmarker names\fR ?\fIpattern\fR?
1779 Returns the names of all the markers that currently exist. If
1780 \fIpattern\fR is supplied, only those markers whose names match it
1781 will be returned.
1782 .TP
1783 \fIpathName \fBmarker type \fImarkerId\fR
1784 Returns the type of the marker given by \fImarkerId\fR, such as
1785 \fBline\fR or \fBtext\fR. If \fImarkerId\fR is not a valid a marker
1786 identifier, \fB""\fR is returned.
1787 .SS "BITMAP MARKERS"
1788 A bitmap marker displays a bitmap. The size of the
1789 bitmap is controlled by the number of coordinates specified. If two
1790 coordinates, they specify the position of the top-left corner of the
1791 bitmap. The bitmap retains its normal width and height. If four
1792 coordinates, the first and second pairs of coordinates represent the
1793 corners of the bitmap. The bitmap will be stretched or reduced as
1794 necessary to fit into the bounding rectangle.
1795 .PP
1796 Bitmap markers are created with the marker's \fBcreate\fR operation in
1797 the form:
1798 .DS
1799 \fIpathName \fBmarker create bitmap \fR?\fIoption value\fR?...
1800 .DE
1801 There may be many \fIoption\fR-\fIvalue\fR pairs, each
1802 sets a configuration options for the marker. These
1803 same \fIoption\fR\-\fIvalue\fR pairs may be used with the marker's
1804 \fBconfigure\fR operation.
1805 .PP
1806 The following options are specific to bitmap markers:
1807 .TP
1808 \fB\-background \fIcolor\fR
1809 Sets the background color of the bitmap. If \fIcolor\fR is \fB""\fR,
1810 the background color will be transparent. The default background
1811 color is \fBwhite\fR.
1812 .TP
1813 \fB\-bitmap \fIbitmap\fR
1814 Specifies the bitmap to be displayed. If \fIbitmap\fR is \fB""\fR,
1815 the marker will not be displayed. The default is \fB""\fR.
1816 .TP
1817 \fB\-foreground \fIcolor\fR
1818 Sets the foreground color of the bitmap. The default foreground color
1819 is \fBblack\fR.
1820 .TP
1821 \fB\-mask \fImask\fR
1822 Specifies a mask for the bitmap to be displayed. This mask is a bitmap
1823 itself, denoting the pixels that are transparent. If \fImask\fR is
1824 \fB""\fR, all pixels of the bitmap will be drawn. The default is
1825 \fB""\fR.
1826 .TP
1827 \fB\-rotate \fItheta\fR
1828 Sets the rotation of the bitmap. \fITheta\fR is a real number
1829 representing the angle of rotation in degrees. The marker is first
1830 rotated and then placed according to its anchor position. The default
1831 rotation is \fB0.0\fR.
1832 .SS "IMAGE MARKERS"
1833 A image marker displays an image. Image markers are
1834 created with the marker's \fBcreate\fR operation in the form:
1835 .DS
1836 \fIpathName \fBmarker create image \fR?\fIoption value\fR?...
1837 .DE
1838 There may be many \fIoption\fR-\fIvalue\fR
1839 pairs, each sets a configuration option
1840 for the marker. These same \fIoption\fR\-\fIvalue\fR pairs may be
1841 used with the marker's \fBconfigure\fR operation.
1842 .PP
1843 The following options are specific to image markers:
1844 .TP
1845 \fB\-anchor \fIanchor\fR
1846 \fIAnchor\fR tells how to position the image relative to the
1847 positioning point for the image. For example, if \fIanchor\fR
1848 is \fBcenter\fR then the image is centered on the point; if
1849 \fIanchor\fR is \fBn\fR then the image will be drawn such that
1850 the top center point of the rectangular region occupied by the
1851 image will be at the positioning point.
1852 This option defaults to \fBcenter\fR.
1853 .TP
1854 \fB\-image \fIimage\fR
1855 Specifies the image to be drawn.
1856 If \fIimage\fR is \fB""\fR, the marker will not be
1857 drawn. The default is \fB""\fR.
1858 .SS "LINE MARKERS"
1859 A line marker displays one or more connected line segments.
1860 Line markers are created with marker's \fBcreate\fR operation in the form:
1861 .DS
1862 \fIpathName \fBmarker create line \fR?\fIoption value\fR?...
1863 .DE
1864 There may be many \fIoption\fR-\fIvalue\fR
1865 pairs, each sets a configuration option
1866 for the marker. These same \fIoption\fR-\fIvalue\fR pairs may be
1867 used with the marker's \fBconfigure\fR operation.
1868 .PP
1869 The following options are specific to line markers:
1870 .TP
1871 \fB\-background \fIcolor\fR
1872 Sets the background color of the line.
1873 The option is affects the line color only when the \fB\-stipple\fR option
1874 is set.
1875 If this option isn't specified then it defaults to \fBwhite\fR.
1876 .TP
1877 \fB\-dashes \fIdashList\fR
1878 Sets the dash style of the line. \fIDashList\fR is a list of up to 11
1879 numbers that alternately represent the lengths of the dashes and gaps
1880 on the line. Each number must be between 1 and 255. If
1881 \fIdashList\fR is \fB""\fR, the marker line will be solid.
1882 .TP
1883 \fB\-foreground \fIcolor\fR
1884 Sets the foreground color. The default foreground color is \fBblack\fR.
1885 .TP
1886 \fB\-linewidth \fIpixels\fR
1887 Sets the width of the lines.
1888 The default width is \fB0\fR.
1889 .TP
1890 \fB\-stipple \fIbitmap\fR
1891 Specifies a stipple pattern used to draw the line, rather than
1892 a solid line.
1893 \fIBitmap\fR specifies a bitmap to use as the stipple
1894 pattern. If \fIbitmap\fR is \fB""\fR, then the
1895 line is drawn in a solid fashion. The default is \fB""\fR.
1896 .SS "POLYGON MARKERS"
1897 A polygon marker displays a closed region described as two or more
1898 connected line segments. It is assumed the first and
1899 last points are connected. Polygon markers are created using the
1900 marker \fBcreate\fR operation in the form:
1901 .DS
1902 \fIpathName \fBmarker create polygon \fR?\fIoption value\fR?...
1903 .DE
1904 There may be many \fIoption\fR-\fIvalue\fR
1905 pairs, each sets a configuration option
1906 for the marker. These same \fIoption\fR\-\fIvalue\fR pairs may be
1907 used with the \fBmarker configure\fR command to change the marker's
1908 configuration.
1909 The following options are supported for polygon markers:
1910 .TP
1911 \fB\-dashes \fIdashList\fR
1912 Sets the dash style of the outline of the polygon. \fIDashList\fR is a
1913 list of up to 11 numbers that alternately represent the lengths of
1914 the dashes and gaps on the outline. Each number must be between 1 and
1915 255. If \fIdashList\fR is \fB""\fR, the outline will be a solid line.
1916 .TP
1917 \fB\-fill \fIcolor\fR
1918 Sets the fill color of the polygon. If \fIcolor\fR is \fB""\fR, then
1919 the interior of the polygon is transparent.
1920 The default is \fBwhite\fR.
1921 .TP
1922 \fB\-linewidth \fIpixels\fR
1923 Sets the width of the outline of the polygon. If \fIpixels\fR is zero,
1924 no outline is drawn. The default is \fB0\fR.
1925 .TP
1926 \fB\-outline \fIcolor\fR
1927 Sets the color of the outline of the polygon. If the polygon is
1928 stippled (see the \fB\-stipple\fR option), then this represents the
1929 foreground color of the stipple. The default is \fBblack\fR.
1930 .TP
1931 \fB\-stipple \fIbitmap\fR
1932 Specifies that the polygon should be drawn with a stippled pattern
1933 rather than a solid color. \fIBitmap\fR specifies a bitmap to use as
1934 the stipple pattern. If \fIbitmap\fR is \fB""\fR, then the polygon is
1935 filled with a solid color (if the \fB\-fill\fR option is set). The
1936 default is \fB""\fR.
1937 .SS "TEXT MARKERS"
1938 A text marker displays a string of characters on one or more lines of
1939 text. Embedded newlines cause line breaks. They may be used to
1940 annotate regions of the strip chart. Text markers are created with the
1941 \fBcreate\fR operation in the form:
1942 .DS
1943 \fIpathName \fBmarker create text \fR?\fIoption value\fR?...
1944 .DE
1945 There may be many \fIoption\fR-\fIvalue\fR pairs,
1946 each sets a configuration option for the text marker.
1947 These same \fIoption\fR\-\fIvalue\fR pairs may be used with the
1948 marker's \fBconfigure\fR operation.
1949 .PP
1950 The following options are specific to text markers:
1951 .TP
1952 \fB\-anchor \fIanchor\fR
1953 \fIAnchor\fR tells how to position the text relative to the
1954 positioning point for the text. For example, if \fIanchor\fR is
1955 \fBcenter\fR then the text is centered on the point; if
1956 \fIanchor\fR is \fBn\fR then the text will be drawn such that the
1957 top center point of the rectangular region occupied by the text will
1958 be at the positioning point. This default is \fBcenter\fR.
1959 .TP
1960 \fB\-background \fIcolor\fR
1961 Sets the background color of the text string. If \fIcolor\fR is
1962 \fB""\fR, the background will be transparent. The default is
1963 \fBwhite\fR.
1964 .TP
1965 \fB\-font \fIfontName\fR
1966 Specifies the font of the text. The default is
1967 \fB*-Helvetica-Bold-R-Normal-*-120-*\fR.
1968 .TP
1969 \fB\-foreground \fIcolor\fR
1970 Sets the foreground color of the text. The default is \fBblack\fR.
1971 .TP
1972 \fB\-justify \fIjustify\fR
1973 Specifies how the text should be justified. This matters only when
1974 the marker contains more than one line of text. \fIJustify\fR must be
1975 \fBleft\fR, \fBright\fR, or \fBcenter\fR. The default is
1976 \fBcenter\fR.
1977 .TP
1978 \fB\-padx \fIpad\fR
1979 Sets the padding to the left and right exteriors of the text.
1980 \fIPad\fR can be a list of one or two screen distances. If \fIpad\fR
1981 has two elements, the left side of the text is padded by the first
1982 distance and the right side by the second. If \fIpad\fR has just one
1983 distance, both the left and right sides are padded evenly. The
1984 default is \fB4\fR.
1985 .TP
1986 \fB\-pady \fIpad\fR
1987 Sets the padding above and below the text. \fIPad\fR can be a list of
1988 one or two screen distances. If \fIpad\fR has two elements, the area above the
1989 text is padded by the first distance and the area below by the second.
1990 If \fIpad\fR is just one distance, both the top and bottom areas
1991 are padded evenly. The default is \fB4\fR.
1992 .TP
1993 \fB\-rotate \fItheta\fR
1994 Specifies the number of degrees to rotate the text. \fITheta\fR is a
1995 real number representing the angle of rotation. The marker is first
1996 rotated along its center and is then drawn according to its anchor
1997 position. The default is \fB0.0\fR.
1998 .TP
1999 \fB\-text \fItext\fR
2000 Specifies the text of the marker. The exact way the text is
2001 displayed may be affected by other options such as \fB\-anchor\fR or
2002 \fB\-rotate\fR.
2003 .SS "WINDOW MARKERS"
2004 A window marker displays a widget at a given position.
2005 Window markers are created with the marker's \fBcreate\fR operation in
2006 the form:
2007 .DS
2008 \fIpathName \fBmarker create window \fR?\fIoption value\fR?...
2009 .DE
2010 There may be many \fIoption\fR-\fIvalue\fR
2011 pairs, each sets a configuration option
2012 for the marker. These same \fIoption\fR\-\fIvalue\fR pairs may be
2013 used with the marker's \fBconfigure\fR command.
2014 .PP
2015 The following options are specific to window markers:
2016 .TP
2017 \fB\-anchor \fIanchor\fR
2018 \fIAnchor\fR tells how to position the widget relative to the
2019 positioning point for the widget. For example, if \fIanchor\fR is
2020 \fBcenter\fR then the widget is centered on the point; if \fIanchor\fR
2021 is \fBn\fR then the widget will be displayed such that the top center
2022 point of the rectangular region occupied by the widget will be at the
2023 positioning point. This option defaults to \fBcenter\fR.
2024 .TP
2025 \fB\-height \fIpixels\fR
2026 Specifies the height to assign to the marker's window. If this option
2027 isn't specified, or if it is specified as \fB""\fR, then the window is
2028 given whatever height the widget requests internally.
2029 .TP
2030 \fB\-width \fIpixels\fR
2031 Specifies the width to assign to the marker's window. If this option
2032 isn't specified, or if it is specified as \fB""\fR, then the window is
2033 given whatever width the widget requests internally.
2034 .TP
2035 \fB\-window \fIpathName\fR
2036 Specifies the widget to be managed. \fIPathName\fR must
2037 be a child of the \fBstripchart\fR widget.
2038 .SH "GRAPH COMPONENT BINDINGS"
2039 Specific stripchart components, such as elements, markers and legend
2040 entries, can have a command trigger when event occurs in them, much
2041 like canvas items in Tk's canvas widget. Not all event sequences are
2042 valid. The only binding events that may be specified are those
2043 related to the mouse and keyboard (such as \fBEnter\fR, \fBLeave\fR,
2044 \fBButtonPress\fR, \fBMotion\fR, and \fBKeyPress\fR).
2045 .sp
2046 Only one element or marker can be picked during an event. This means,
2047 that if the mouse is directly over both an element and a marker, only
2048 the uppermost component is selected. This isn't true for legend entries.
2049 Both a legend entry and an element (or marker) binding commands
2050 will be invoked if both items are picked.
2051 .sp
2052 It is possible for multiple bindings to match a particular event.
2053 This could occur, for example, if one binding is associated with the
2054 element name and another is associated with one of the element's tags
2055 (see the \fB\-bindtags\fR option). When this occurs, all of the
2056 matching bindings are invoked. A binding associated with the element
2057 name is invoked first, followed by one binding for each of the element's
2058 bindtags. If there are multiple matching bindings for a single tag,
2059 then only the most specific binding is invoked. A continue command
2060 in a binding script terminates that script, and a break command
2061 terminates that script and skips any remaining scripts for the event,
2062 just as for the bind command.
2063 .sp
2064 The \fB\-bindtags\R option for these components controls addition
2065 tag names which can be matched. Implicitly elements and markers
2066 always have tags matching their names. Setting the value of
2067 the \fB\-bindtags\fR option doesn't change this.
2068 .SH "C LANGUAGE API"
2069 You can manipulate data elements from the C language. There
2070 may be situations where it is too expensive to translate the data
2071 values from ASCII strings. Or you might want to read data in a
2072 special file format.
2073 .PP
2074 Data can manipulated from the C language using BLT vectors.
2075 You specify the x and y data coordinates of an element as vectors and
2076 manipulate the vector from C. The strip chart will be redrawn automatically
2077 after the vectors are updated.
2078 .PP
2079 From Tcl, create the vectors and configure the element to use them.
2080 .CS
2081 vector X Y
2082 \&.s element configure line1 -xdata X -ydata Y
2083 .CE
2084 To set data points from C, you pass the values as arrays of doubles
2085 using the \fBBlt_ResetVector\fR call. The vector is reset with the
2086 new data and at the next idle point (when Tk re-enters its event
2087 loop), the strip chart will be redrawn automatically.
2088 .CS
2089 #include <tcl.h>
2090 #include <blt.h>
2091
2092 register int i;
2093 Blt_Vector *xVec, *yVec;
2094 double x[50], y[50];
2095
2096 /* Get the BLT vectors "X" and "Y" (created above from Tcl) */
2097 if ((Blt_GetVector(interp, "X", 50, &xVec) != TCL_OK) ||
2098 (Blt_GetVector(interp, "Y", 50, &yVec) != TCL_OK)) {
2099 return TCL_ERROR;
2100 }
2101
2102 for (i = 0; i < 50; i++) {
2103 x[i] = i * 0.02;
2104 y[i] = sin(x[i]);
2105 }
2106
2107 /* Put the data into BLT vectors */
2108 if ((Blt_ResetVector(xVec, x, 50, 50, TCL_VOLATILE) != TCL_OK) ||
2109 (Blt_ResetVector(yVec, y, 50, 50, TCL_VOLATILE) != TCL_OK)) {
2110 return TCL_ERROR;
2111 }
2112 .CE
2113 See the \fBvector\fR manual page for more details.
2114 .SH SPEED TIPS
2115 There may be cases where the strip chart needs to be drawn and updated as
2116 quickly as possible. If drawing speed becomes a big
2117 problem, here are a few tips to speed up displays.
2118 .TP 2
2119 \(bu
2120 Try to minimize the number of data points. The more data points
2121 the looked at, the more work the strip chart must do.
2122 .TP 2
2123 \(bu
2124 If your data is generated as floating point values, the time required
2125 to convert the data values to and from ASCII strings can be
2126 significant, especially when there any many data points. You can
2127 avoid the redundant string-to-decimal conversions using the C API to
2128 BLT vectors.
2129 .TP 2
2130 \(bu
2131 Data elements without symbols are drawn faster than with symbols.
2132 Set the data element's \fB\-symbol\fR option to \fBnone\fR. If you need to
2133 draw symbols, try using the simple symbols such as \fBsplus\fR and
2134 \fBscross\fR.
2135 .TP 2
2136 \(bu
2137 Don't stipple or dash the element. Solid lines are much faster.
2138 .TP 2
2139 \(bu
2140 If you update data elements frequently, try turning off the
2141 widget's \fB\-bufferelements\fR option. When the strip chart is first
2142 displayed, it draws data elements into an internal pixmap. The pixmap
2143 acts as a cache, so that when the strip chart needs to be redrawn again, and
2144 the data elements or coordinate axes haven't changed, the pixmap is
2145 simply copied to the screen. This is especially useful when you are
2146 using markers to highlight points and regions on the strip chart. But if
2147 the strip chart is updated frequently, changing either the element data or
2148 coordinate axes, the buffering becomes redundant.
2149 .SH LIMITATIONS
2150 Auto-scale routines do not use requested min/max limits as boundaries
2151 when the axis is logarithmically scaled.
2152 .PP
2153 The PostScript output generated for polygons with more than 1500
2154 points may exceed the limits of some printers (See PostScript Language
2155 Reference Manual, page 568). The work-around is to break the polygon
2156 into separate pieces.
2157 .SH "FUTURE INCOMPATIBILITY"
2158 The \fB\-mapped\fR options are obsoleted and will be removed. You can
2159 achieve the same results using the \fB\-hide\fR option instead.
2160 .CS
2161 # Works for now.
2162 \&.s legend configure -mapped no
2163
2164 # Instead use this.
2165 \&.s legend configure -hide yes
2166 .CE
2167 .SH KEYWORDS
2168 stripchart, graph, widget