plot

Block Category: Signal Consumer

Description: The plot block displays data in a customizable two-dimensional plot. You can customize the plot and control how data is displayed.

Use the Edit > Clear Plots/Display command to clear the plot.

Memory usage: The plot block uses eight bytes per data point of RAM. If you are running a long simulation at a small step size, it is possible to exceed your RAM limit. For example, a simulation with a step size of 0.005 and duration of 32236 would require 6.4 million points of data per plot trace. At eight bytes per point, each plot trace uses 51MB of RAM. If you used all eight traces on a plot block, you would exceed 412MB of RAM.

Memory usage is calculated at the start of a simulation so you will know immediately if the simulation cannot run due to memory issues.

Basic time domain plots: When you wire a plot block into your diagram and run a simulation, the simulation data is initially presented in time domain. All the signals are plotted on the y-axis; the x-axis represents time. As data points arrive to be plotted, plot bounds are dynamically re-scaled and data points are automatically connected with line segments.

Code generation for plots: If you have a version of Embed that lets you generate code, plot blocks are ignored during code generation.

In the above plot, ball position and air friction are displayed as functions of time. The peak ball position follows an exponential decay, governed by air viscosity. The signals are distinguished by line patterns, a feature the plot block automatically performs when displaying or printing on monochrome devices. To make the plot more meaningful, signal labels and a title were also added.

XY plots: In an XY plot, you can use one input signal to represent X coordinate generation. As time advances, the remaining input signals are plotted relative to the x-axis signal.

In the XY plot above, ball position is plotted against air friction. At time 0, the ball position is at 2 and air friction is at 0. Over the course of the simulation, the ball position moves counter-clockwise, following a three-sided decaying cycle.

To specify an XY plot

1.    Right-click the plot block, or choose Edit > Block Properties and click the block.

2.    Click the Options tab.

3.    Activate XY Plot.

4.    In the X Axis drop-down menu, choose the input signal to be used for x coordinate generation: 1 represents the input signal attached to the top input connector tab on the plot block, 2 represents the input signal attached to the second to the top input connector tab on the plot block, and so on.

5.    Click OK, or press ENTER.

To label the X axis on an XY plot

In an XY plot, Embed automatically labels the x axis with the label for the input signal used for x coordinate generation. For example, if you activate XY Plot and choose 2 under X Axis, Embed uses the label assigned to input signal 2.

1.    Right-click the plot block, or choose Edit > Block Properties and click the block.

2.    Click the Labels tab.

3.    Enter a label for the input signal used for x coordinate generation. The Trace 1 box corresponds to 1 in X Axis, the Trace 2 box corresponds to 2 in X Axis, and so on. 

4.    Click OK, or press ENTER.

Zooming and sizing plots:

To size plots

      Click Maximize in the upper right corner of the plot to expand to full screen size.

      Drag the plot borders or corners to manually adjust plot size.

To zoom in

You can zoom in on data points to view them at a magnified size. You can zoom in several times in a row for greater magnification. If the area you’re zooming in on does not contain at least one data point, the magnified area will be blank.

1.    Point to one corner of the area you want to select.

2.    To anchor the corner, CTRL+depress.

3.    Drag the pointer until the box encloses the area you want to magnify. A status box in the lower left-hand corner of the plot displays the pointer position.

4.    Release the button and CTRL key.

To zoom out

CTRL+right-click the plot.

Printing plots: To print just a plot, click the control-menu box in the upper left-hand corner of the plot and select Print.

Plotting vector data: To plot vector data, use the External Trigger parameter under the Options tab. This gives you control over when to update vector data.

To save vector data to a file and read it in another application, such as Excel, use the export block.