Plot cursors are horizontal or vertical lines you can position on time-plots and XY plots to provide visual guides for important values. Vertical cursors can also limit the range of data included in the summary table. Cursors can be positioned numerically, moved interactively or repositioned using serial commands sent from your Arduino program. MegunoLink imposes no limit on the number of cursors that can be added to a plot.
Use the cursor panel to manage a plot’s cursors. The View cursors panel button () toggles the panel visibility. Use the buttons at the top of the cursors panel to add, edit, reorder and remove cursors.
The Edit Cursor dialog is displayed when you add or edit a cursor to set the name, behavior and appearance of your cursor. Serial commands sent from your Arduino sketch to hide/show and move cursors refer to them by Name.
Cursors are drawn parallel to the x-axis (horizontal orientation) or y-axis (vertical orientation). The Position property controls the location of the cursor: its y-value for horizontal cursors or x-value for vertical cursors.
Attachment controls how a cursor’s position is interpreted. When a cursor is attached to the view, its position is relative to the width of the scale: 0 places the cursor at the left/bottom edge of the scale; 1 places the cursor at the right/top edge of the scale; 0.5 places the cursor in the middle of the scale. When a cursor is attached to the scale, position is scale value where the cursor is drawn. This means that cursors attached to the view don’t move when the axis limits are changed but cursors attached to the scale move with the scale. Horizontal cursors can be attached to the left or right y-axis.
Cursors can be moved interactively. Select the move cursors tool () then use your mouse to select and drag cursors directly on the plot.
Cursors can be shown, hidden and their position updated using serial commands sent from your Arduino sketch. Use either a
XYPlot variable and the
ShowCursor(CursorName, Visible — optional),
SetCursorPosition(CursorName, NewPosition, PositionDecimalPlaces — optional) methods. See plot formatting for details.
// The temperature that we turn off the heater, in degrees Celsius.
double TemperatureSetPoint = 25.0;
void UpdateTemperatureSetPoint(double NewSetPoint)
TemperatureSetPoint = NewSetPoint;
Plot.SetCursorPosition(F("Temperature Set Point"), NewSetPoint);