XY Scatter / Trajectory Chart
The XY Scatter / Trajectory Chart plots data on a two-dimensional plane. Each channel is a separate trajectory made of (X, Y) coordinate points, accumulated in the order they are received. It suits observing motion paths, the positions of several targets, or error distributions such as gyroscope bias scatter.
Both axes show data values, and the horizontal axis is not time. Unlike the Data Waveform, arrival order appears only in the arrangement of the points, and the newest point is highlighted as a solid circle.
Data Requirements
Each channel uses two consecutive values. The first is X, and the second is Y.
| Channel | X | Y |
|---|---|---|
| Channel 1 | 1st value | 2nd value |
| Channel 2 | 3rd value | 4th value |
| Channel N | (2N-1)th value | (2N)th value |
- The unit and range of the values are not restricted. The plugin does not convert units, and X and Y are handled separately.
- There is one channel by default. To show more trajectories, add channels in the Channels dialog. The maximum is 10.
- If there are not enough values for a full pair, that channel is not updated in this round. For example, if only 3 values arrive, only Channel 1 updates and the 3rd value is ignored.
- If X or Y is NaN or infinite, only that coordinate point is discarded. Other channels still update.
Example: with 2 channels, receiving 1.2,3.4,-0.5,2.0 gives the point (1.2, 3.4) for Channel 1 and (-0.5, 2.0) for Channel 2.
Data Source
There are two data sources: Text Split and Variable Rendering. The general rules for both, including how the two modes exclude each other and the refresh modes, are described in the Plugins Overview. This page explains only how values are paired.
Text Split (Default)
- Values are paired in the order received and assigned to the channels one pair at a time. Values 1 and 2 form the X and Y of Channel 1, values 3 and 4 form Channel 2, and so on.
- Empty parts are skipped. If you use an empty part to mark a missing value, the later pairs shift out of place. For example,
1,,2,3is treated as1,2,3. The first pair is (1, 2), and the 3rd value is ignored. - A part that cannot be converted to a number is recorded as a missing value (NaN). That coordinate point is discarded, and the other channels still update.
- Example: with Prefix set to
$XY,, Separator set to,, and 2 channels, receiving$XY,1.2,3.4,-0.5,2.0gives the point (1.2, 3.4) for Channel 1 and (-0.5, 2.0) for Channel 2.
Variable Rendering
- Checked variables are paired from top to bottom in the variable list, not in the order they were checked. The first two variables form the X and Y of Channel 1, the third and fourth form Channel 2, and so on.
- The number of channels is set automatically to half the number of variables, rounded up. The maximum is 10 channels, so at most 20 variables are used.
- If the number of variables is odd, the last variable is used only as X. Its channel draws no point.
- The channel name changes to "X variable name / Y variable name". A channel without a Y variable is named after its X variable.
- At least two variables must be checked. With only one variable there is no complete pair, so nothing is drawn.
- Entering or leaving variable mode changes the number of channels. If the number decreases, the trajectories are cleared. After leaving variable mode, the number of channels returns to what it was before.
Channel Settings
In the Channels dialog, you can set the name, unit, color, and visibility of each channel.
- Add and Remove change the number of channels between 1 and 10. A button is disabled when its limit is reached.
- The name appears in the legend. The color is used for the trajectory and the legend dot. The unit appears after the coordinates in the legend.
- When Show this channel is cleared, the channel is no longer drawn, does not receive new points, and is excluded from automatic range calculation. Its existing points are kept. In the channel list, hidden channels are marked "(hidden)".
- The range minimum and range maximum fields are hidden for this plugin. The axis range is set with the X and Y inputs on the toolbar.
- In variable mode, channel names come from the variables and cannot be edited. Add and Remove are disabled. Color, unit, and visibility can still be changed.
- When the number of channels decreases, the trajectories of all channels are cleared. Adding a channel does not clear existing trajectories.
Display
Axes and Grid
- The axes are on the left and at the bottom of the plot. Each axis is divided into 5 equal parts, giving 6 tick marks including both ends. The background has an 8-cell dotted grid. Tick labels show no units, and the axes are labeled X and Y.
- When 0 falls within the visible range, dashed reference lines are drawn at X=0 and Y=0.
- All channels share one set of axes. When one channel has much larger values than the others, the other trajectories are compressed into a small area.
- The X and Y scales are not locked. When the two ranges differ, a circular trajectory appears as an ellipse.
Trajectories and Points
- Earlier points are semi-transparent dots. The newest point is a solid circle with a white outline.
- When Show Line is on, the points are joined in the order received, using the channel color.
- Earlier points that fall in the same 2×2 pixel cell are drawn once. This keeps drawing fast with many points, and overlapping areas do not darken from stacked dots.
Upper-Right Legend
Each visible channel takes one row: a colored dot, the name, and the latest coordinates, shown as Name: (X, Y) Unit. The coordinates have 3 decimal places. The unit is omitted when it is empty. A channel with no data shows Name: --. When there are many channels and the plot area is short, only the rows that fit are shown.
Mouse Hover
When the mouse moves over the plot area, a tooltip shows the X and Y values at the cursor, with 4 decimal places.
Toolbar
From left to right, the toolbar has the X and Y range inputs, the Max Points drop-down, and the buttons. The following two items are controls, not buttons:
| Control | Description |
|---|---|
| X and Y range inputs | Set the lower and upper limits of each axis. When Auto is on, they show the current range. Editing either input turns Auto off. See "Axis Range" below |
| Max Points | Drop-down. Sets the maximum number of points kept for each channel. Options are 500, 1000, 2000, 5000, 10000, 20000, 50000, and 100000. The default is 20000. When the limit is reached, the oldest point of that channel is removed |
The buttons follow, in the same order as they appear from left to right:
| Icon | Button | Description |
|---|---|---|
| Channels | Opens the Channels dialog to edit each channel's name, unit, color, and visibility. You can also add or remove channels. See Channel Settings | |
| Show Line | Checkable, off by default. When checked, points are joined in the order received. When unchecked, only points are shown | |
| Auto | Checkable, on by default. When checked, the axis range follows the data automatically. When unchecked, the manual range in the X and Y inputs is used | |
| Reset | In automatic mode, recalculates the range from the current data. In manual mode, sets the manual range from the current data | |
| Clear | Removes all points from all channels. Channel settings are kept | |
| Variable | Opens the Variable rendering settings dialog. The button is checked when variable mode is on. Clicking the button only opens the dialog, and variable mode turns on when Enable variable mode is checked there. The main options are the variable list (at least one variable must be checked), the refresh mode (Refresh on receive or Timed refresh), and the refresh interval | |
| Text | Opens the Text split settings dialog. The button is checked when Text Split is on. Clicking the button only opens the dialog, and Text Split turns on when Enable text mode is checked there. The main options are the Prefix and Separator fields (the separator cannot be empty) and a parsing preview | |
| Help | Opens this plugin's online help page in your browser. |
Axis Range
- When Auto is on, the axis range is calculated from the data of all channels, with a 10% margin beyond the minimum and maximum values. The range inputs show the current range in real time.
- When Auto is off, the manual range in the inputs is used. Points outside this range are not shown, and they do not expand it.
- Editing any range input turns Auto off and uses the input values as the manual range. The change takes effect after you press Enter or leave the input box.
- When switching from automatic to manual, the manual range is set to the automatic range at that moment, rounded outward to 4 decimal places. If there is no data, the existing manual range is kept.
- Reset in automatic mode recalculates the range from the current data. In manual mode, it sets the manual range from the current data. Use it to bring back trajectories that are off screen because the manual range no longer matches the data. If there is no data, the manual range does not change.
- If the upper limit is less than or equal to the lower limit, the range shown runs from the lower limit to the lower limit plus 1. The input values do not change.
- The range inputs show 4 decimal places and accept values from -1000000000 to 1000000000. A range smaller than 0.0001 cannot be set accurately in the inputs.
Notes
- The history of each channel is limited by Max Points. More points keep a longer history but redraw more slowly.
- When drawing becomes slow, the refresh interval increases automatically, up to 500 ms. Under normal conditions it is about 33 ms.
- In automatic mode, when one channel has a very large value range, the other trajectories become small. In that case, hide the channels you do not need or use a manual range.
- When both Text Split and Variable Rendering are off, the plugin splits received text by English commas.
