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