OSDN Git Service

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