Skip to main content

Cursor

Cursor [flags] cursorName traceName x_value

Cursor [flags] cursorName traceName x_value, y_value

Cursor /K [/W=graphName ] cursorName

Cursor /I [/F] [flags] cursorName image_name x_value, y_value

Cursor /M [flags] cursorName

The Cursor operation moves the cursor specified by cursorName onto the named trace at the point whose X value is x_value or the coordinates of an image pixel or free cursor position at x_value and y_value .

Parameters

cursorName is one of ten cursors A through J.

Flags

/A=a
a =0:Deactivates the cursor.
a =1:Activates the cursor.
Active cursors move with arrow keys or the cursor panel.
/C=(r,g,b,[a] )Sets the cursor color. r, g, b, and a specify the the color and optional opacity as RGBA Values. The default is opaque black.
/DF=formatSets the format to use when displaying date/time data in the Graph Info Panel (see Info Panel and Cursors).
The /DF flag was added in Igor Pro 9.00.
The values for format are:
0:Compact format: YYMMDD HHMM.
1:Compact format with seconds added: YYMMDD HHMMSS. The seconds portion may optionally show fractions of seconds - see the /SDGT flag below.
2:Date and Time using a more readable format, the same format you get on a graph axis if you select the "short date" format. Time is formatted as HH:mm.
3:Date and Time with seconds added. Time is formatted as HH:mm:ss. The seconds portion may optionally show fractions of seconds - see the /SDGT flag below.
4:Time without the date. Time is formatted as HH:mm:ss. May optionally show fractions of seconds - see the /SDGT flag below.
/DGTS=ndSets the number of digits precision to use when a cursor value is displayed in the Graph Info Panel (see Info Panel and Cursors). The number of digits is set by nd and must be a value from 1 to 15.
The /DGTS flag was added in Igor Pro 9.00.
/FAllows cursor to roam free. The trace or image provides the axis pair that defines x and y coordinates for the setting and readout. Use /P to set in relative coordinates, where 0,0 is the top left corner of the rectangle defined by the axes and 1,1 is the right bottom corner.
The fundamental coordinates for a free cursor are plot relative; the ability to use a trace or image is just a convenient way to find the axes for the readout coordinates.
/H=hSpecifies crosshairs on cursors.
h =0:Full crosshairs off.
h =1:Full crosshairs on.
h =2:Vertical hairline.
h =3:Horizontal hairline.
/IPlace cursor on specified image.
/KRemoves the named cursor from the top graph.
/L=lStyleLine style for crosshairs (full or small).
lStyle =0:Solid lines.
lStyle =1:Alternating color dash.
/MModifies properties without need to specify trace or image coordinates. Does not work with the /F or /I flags.
/N=noKillDetermines if the cursor is removed ("killed") if the user drags it outside of the plot area:
noKill =0:Remove the cursor (default)
noKill =1:Do not remove the cursor
/NUML=nUsed in conjunction with /H when h is non-zero. Sets the number of crosshair lines to draw. n must be between 1 and 3. When n is greater than 1, the line separation is set by the /T=t flag. If n = 2 or 3 and t is less than 3, the line appears as if n is 1. If n = 3 and t is less than 5, the appearance reverts to n = 2. Lines are symmetrically disposed around the cursor position. When n = 3, t sets the separation of the outer pair of lines.
/NUML was added in Igor Pro 7.00.
/PInterprets x_value as a point number rather than as an X value. If the cursor is on a trace representing a subrange of a wave, the point numbers are "trace" point numbers. See Details below.
When used with the /I flag, x_value and y_value are row and column numbers.
When used with the /F flag, x_value and y_value are relative graph coordinates (0-1).
/S=sSets cursor style.
s =0:Original square or circle.
s =1:Small crosshair with letter.
s =2:Small crosshair without letter.
/SDGT=ndSet the number of places to the right of the decimal point to be displayed in the Graph Info Panel (see Info Panel and Cursors) when the display is in one of the date/time modes that includes seconds, or if the corresponding axis is showing elapsed time. nd is a value from 0 to 6.
The /SDGT flag was added in Igor Pro 9.00.
/T=tSets the thickness of crosshair lines for /H when h is non-zero. If /NUML sets the number of lines greater than 1 then /T sets the separation of the outer pair of lines.
t is the line thickness or separation distance in units of pixels. The default is /T=1.
The form /T={mode , t1 , t2 } provides finer control.
/T was added in Igor Pro 7.00.
/T={mode , t1 , t2 }Sets the thickness of crosshair lines for /H when h is non-zero. If /NUML sets the number of lines greater than 1 then /T sets the separation of the outer pair of lines.
If mode =1 then t1 and t2 are in units of screen pixels. t1 is the vertical line thickness or separation distance and t2 is the horizontal line thickness or separation distance.
The default crosshair appearance is equivalent to /T={1,1,1}.
If mode =0 then t1 and t2 are in units of axis coordinates and consequently track changes in axis range and graph size. Normally t1 is the vertical line thickness or separation distance and t2 is the horizontal line thickness or separation distance but they are swapped if the trace or graph is in swap XY mode.
/T was added in Igor Pro 7.00.
/W=graphNameSpecifies the name of a particular graph window or subwindow. When omitted, action will affect the active window or subwindow
When identifying a subwindow with graphName, see Subwindow Syntax for details on forming the window hierarchy.

Details

Usually traceName is the same as the name of the wave displayed by that trace, but it could be a name in instance notation. See ModifyGraph for a discussion of trace names and instance notation.

A string containing traceName can be used with the $ operator to specify traceName.

x_value is an X value in terms of the X scaling of the wave displayed bytraceName. If traceName is graphed as an XY pair, then x_value is not the same as the X axis coordinate. Since the X scaling is ignored when displaying an XY pair in a graph, we recommend you use the /P flag and use a point number for x_value.

cursorName is a name, not a string.

To get a cursor readout, choose ShowInfo from the Graph menu.

If a cursor is attached to a trace that represents a subrange of a wave, the /P flag causes x_value to be interpreted as a trace point number, not as a wave point number. For instance, if the trace was created by the command

Display yWave[4,25;3]

then x_value=0 references trace point 0 which corresponds to wave point 4, and x_value=1 references trace point 1 which corresponds to wave point 7.

Moving a cursor in a macro or function does not immediately erase the old cursor. DoUpdate has to be explicitly called.

Examples

AppendToGraph myWave                // X coordinates from X scaling of myWave
Cursor A, myWave, leftx(myWave) // cursor A on first point of myWave

AppendToGraph yWave vs xWave // X coordinates from xWave, not X scaling
Cursor/P B, yWave,numpnts(yWave)-1 // cursor B on last point of yWave
DoUpdate // erase any old A or B cursors

See Also

Programming With Cursors, DoUpdate