XY-Plot Library Reference

 In Plotting

The XYPlot class provides a convenient set of methods for setting properties and sending data to the MegunoLink Pro X-Y Plot visualizer.

To use the XYPlot functions:

  1. Install the MegunoLink Pro Arduino library
  2. Add #include “MegunoLink.h” to the top of your Arduino program
  3. Create a XYPlot variable
  4. Call methods on the XYPlot variable

Example

This example sends the voltage from the first two analog channels as x and y values to MegunoLink Pro every 200 ms.

Description

The XY Plot shows pairs of numerical data on a graph.

Multiple plots are supported using channels. Each plot visualizer in MegunoLink Pro shows the set of series for one channel. The channel used when sending commands is specified in the XYPlot constructor. Channels are optional. If not specified, the default channel is used and all data will appear on any plot that doesn’t have a specific channel selected.

Data is collected together in series for plotting with new values appended as it arises. Series names are used to identify each collection of data and to set the line and marker styles for plotting.

Methods

TimePlot(ChannelName — optional ) (constructor)
SendData(SeriesName, XValue, YValue, SeriesProperties — optional )
SendData(SeriesName, XValue, YValue, Color, LineStyle, LineWidth, MarkerStyle)
SendData(SeriesName, XValue, YValue, DecimalPlaces, SeriesProperties — optional )
SendData(SeriesName, XValue, YValue, DecimalPlaces, Color, LineStyle, LineWidth, MarkerStyle)
SetTitle(Title)
SetXLabel(Label)
SetYLabel(Label)
SetSeriesProperties(SeriesName, Color, LineStyle, LineWidth, MarkerStyle)
SetSeriesProperties(SeriesName, SeriesProperties)

Style Types

Colors = { Red, Green, Blue, Yellow, Black, Magenta, Cyan, White }
LineStyle = { Solid, Dashed, Dotted, DashDot, DashDotDot, NoLine }
MarkerStyle = { Square, Diamond, Triangle, Circle, Cross, Plus, Star, DownwardTriangle, NoMarker }

Detailed Descriptions

XYPlot(ChannelName — optional )

Constructs an x-y plot variable, with an optional ChannelName. This variable can be used to send data to MegunoLink Pro plots.

SendData(SeriesName, XValue, YValue, SeriesProperties — optional )

Send (XValue, YValue), a pair of numbers, to MegunoLink Pro where it will be added to the series SeriesName on an X-Y Plot. A series property string may be specified to set the series style.

SendData(SeriesName, XValue, YValue, Color, LineStyle, LineWidth, MarkerStyle)

Send (XValue, YValue), a pair of numbers, to MegunoLink Pro where it will be added to the series SeriesName. Also sets the color, line-style, line-width and marker style used for plotting.

SendData(SeriesName, XValue, YValue, DecimalPlaces, SeriesProperties — optional )

Send (XValue, YValue), a pair of floating point numbers, to MegunoLink Pro where it will be added to the series SeriesName. DecimalPlaces sets the number of decimal places to use when the data is sent. A series property string may be specified to set the series style.

SendData(SeriesName, XValue, YValue, DecimalPlaces, Color, LineStyle, LineWidth, MarkerStyle)

Send the (XValue, YValue), a pair of floating point numbers, to MegunoLink Pro where it will be added to the series SeriesName. DecimalPlaces sets the number of decimal places to use when the data is sent. Also sets the color, line-style, line-width and marker style used for plotting.

SetTitle(Title)

Sets the plot title.

SetXLabel(Label)

Sets the label displayed on the plot’s x-axis.

SetYLabel(Label)

Sets the label displayed on the plot’s y-axis.

SetSeriesProperties(SeriesName, Color, LineStyle, LineWidth, MarkerStyle)

Set the color, line-style, line-width and marker style used for plotting the given series.

SetSeriesProperties(SeriesName, SeriesProperties)

Sets one or more of the color, line-style, line-width and marker style used for plotting the given series with a series property string

Recent Posts

Leave a Comment

Contact Us

Send us an email and we will get back to you shortly.

Not readable? Change text.

Start typing and press Enter to search