You can create multiple plots, and send different data to each, using channels. This is useful if, for example, you’d like to plot temperature on one graph and battery voltage on another. Both Time Plots and XY Plots support multiple plots. And you can have as many plots as you like.
To use multiple plots with our Arduino library, pass a channel name when you create a plot variable.
TimePlot SinePlot("Sin"), CosinePlot("Cos"); will create two
TimePlot variables. One named
SinePlot and the other named
SinePlot will send data to a channel named “Sin” and
CosinePlot will send data to a channel named “Cos”.
float x = 0;
x = x + 0.1;
MegunoLink detects new channels automatically and includes them on the plot by default. So you’ll see both the sine and cosine curves on a single plot when running the Arduino sketch above:
The channels shown by a plot is controlled by the channel selector on the visualizer toolbar.
- When Select new automatically is selected, any newly discovered channels will be shown on the plot
- When Select default is selected, the default channel (the one you get with a
TimePlot Default;variable declaration) will be shown
- When specific channels are selected, only those channels will appear on the plot
To split the channels across multiple plots:
- Create a new time plot by selecting it from the visualizers menu.
- Use the channel selector to choose which channels you want to see on each plot.
So by selecting specific channels for each visualizer you can show data on multiple plots: