HTBasic Help
×
Menu
Index

XY Graph Widget

 
_______________________________________________________
XY GRAPH Widget
Used to plot data on X-Y coordinate plane
_______________________________________________________
 
Legal Usage                Level-0 Widget:                Yes
                 Parent to:                None
                 Child of:                        PANEL
 
Example Image
 
     
 
Example Program
 
See XY GRAPH Widget for an example program that generates a display similar to that shown above.See the following programs for other examples using the XY GRAPH widget:
 
         Frequency Response
         Lissajous Patterns
         XY GRAPH Shared Traces
 
Attributes
 
See XY GRAPH Widget Attributes for the XY GRAPH widget attribute list.
 
Remarks
 
The XY GRAPH widget plots data on an X-Y coordinate plane. The XY GRAPHwidget has most of the same attributes as the STRIPCHART widget. However, the XY GRAPH is intended to display sets of X,Y data points.
 
For the STRIPCHART widget, you assign an X-coordinate POINT LOCATION along the axis and then load an array of Y-coordinate VALUES for that X-coordinate. As you keep incrementing the POINT LOCATION and writing an array with new Y-coordinate VALUES, the STRIPCHART display scrolls and all the traces are updated in parallel.
 
For the XY GRAPH widget, the display appears the same and is set up the same, but it does not scroll (the X axis is fixed). Also, instead of setting an X value and then updating the Y values of all traces, you simultaneously provide ALL the X and Y coordinates for a trace to plot that trace along its entire path. For example:
 
  CONTROL @Xy; SET ("CURRENT TRACE":3,"X DATA":X3(*),"Y DATA":Y3(*))
  CONTROL @Xy; SET ("CURRENT TRACE":4,"X DATA":X4(*),"Y DATA":Y4(*))
  CONTROL @Xy; SET ("CURRENT TRACE":5,"X DATA":X5(*),"Y DATA":Y5(*))
 
If all your data sets have the same X coordinates, you can set SHARED X and only load the X data set once. For example:
 
  CONTROL @Xy; SET ("SHARED X":1,"CURRENT TRACE":1,"X DATA":X(*))
  CONTROL @Xy; SET ("CURRENT TRACE":3,"Y DATA":Y3(*))
  CONTROL @Xy; SET ("CURRENT TRACE":4,"Y DATA":Y4(*))
  CONTROL @Xy; SET ("CURRENT TRACE":5,"Y DATA":Y5(*))
 
For SHARED X mode on the XY GRAPH, the X DATA array is associated with trace 1. Everything else - format options, CURRENT AXIS, CURRENT TRACE, etc. - is the same as for the STRIPCHART widget
 
The MARKER attribute allows you to set the operation of one or two trace markers that the user can move along the specified trace. MARKER can be set to several modes: NONE (no markers), ONE marker, TWO markers, DELTA (difference between X & Y marker values), and RATIO (ratio of marker values). When markers are turned on, the appropriate marker values are displayed on the bottom of the XY GRAPH widget.
 
Traces to be marked are designated with the attributes MARKER1 TRACE and MARKER2 TRACE. The positions of the markers on the trace can be set or queried using the attributes MARKER1 X / MARKER1 Y, and MARKER2 X / MARKER2 Y.You can trap marker movements with the MARKER1 MOVED and MARKER2 MOVED events.
 
Events
 
Events for the XY GRAPH widget are:
 
·
MARKER1 MOVED, MARKER2 MOVED
·
SYSTEM MENU
 
MARKER1 MOVED, MARKER2 MOVED
 
This event is generated when a marker is moved.
 
SYSTEM MENU
 
This event is generated when the operator selects items from the SYSTEM MENU.