Complete the following steps to plot x, y, and z data on an ActiveX 3D surface graph.
- Add an ActiveX 3D surface graph to the front panel.
||Note The 3D graph controls are available only in the LabVIEW Full and Professional Development Systems.|
- On the block diagram, delete the 3D Surface VI and the wire to the VI. This leaves only the ActiveX container terminal for the 3D graph.
- Add an Invoke Node to the block diagram, and wire the 3D graph container terminal to the reference input of the Invoke Node.
- Right-click the Invoke Node and select Select Method»Plot3DMesh from the shortcut menu. The Plot3DMesh method accepts variant data for arrays of x, y, and z data and plots triangulated surfaces.
- Enter variant data to the xVector, yVector, and zVector inputs of the Plot3DMesh method. The values of xVector and yVector specify where the corresponding point in the zVector array is.
The default values for xVector and yVector are 0, 1, 2, 3, and so on. The first point in zVector array (index 0,0) is located at (x vector, y vector), or (0,0). If you change xVector to –1, 1, 2, 3, and so on, the first point in zVector moves to (–1,0).
- (Optional) Wire magnitude data to the wVector input of the Plot3DMesh method to show the magnitude.
- Scale the graph to ensure that array dimensions match. The dimension size of the 2D array is the product of the 1D arrays.
For example, xVector and yVector correspond to the two indexes for the zVector 2D array. If the number of elements in xVector does not match the width of the zVector array in the first dimension, and the number of elements in yVector does not match the width of the zVector array in the second dimension, this method ignores the values of both xVector and yVector.
- Run the VI.
Complete the following steps to show individual points instead of surfaces.
- Right-click the front panel graph and select CWGraph3D»Properties from the shortcut menu.
- Click the Plots tab and change the plot style to Point.
- To avoid getting multiple colors for every point, select None from the Color map style pull-down menu.
||Note You might have to change the default point color and size on the Point page for the data to be visible on the graph.|
- Click the OK button.
- Run the VI.
You also can plot x, y, and z data on a 3D graph XControl.