Main Content

plot

Plot parametric model

Description

example

plot(model) plots a model within the axis limits of the current figure. H is the handle to surf, a 3-D shaded surface plot or patch, a filled polygon region.

plot(model,Name=Value) specifies options using one or more name-value arguments in addition to argument from previous syntax. For example, plot(model,Color="r") sets the color of the plot to red.

H = plot(___) specifies options using one or more name-value arguments. For example, plot(model,Color="r") sets the color of the plot to red.

Examples

collapse all

Load a MAT file containing a point cloud.

load("object3d.mat");

Display the point cloud into the workspace.

figure
pcshow(ptCloud)
xlabel("X(m)")
ylabel("Y(m)")
zlabel("Z(m)")
title("Detect a Plane in a Point Cloud")

Set the maximum point-to-plane distance for plane fitting to 2cm.

maxDistance = 0.02;

Specify the normal vector plane for the fitted plane.

referenceVector = [0 0 1];

Set the maximum angular distance for the fitted plane to 5 degrees.

maxAngularDistance = 5;

Detect the plane, the table, in the point cloud and extract it.

model = pcfitplane(ptCloud,maxDistance,referenceVector,maxAngularDistance);

Plot the plane.

hold on
plot(model)

Input Arguments

collapse all

Parametric model returned by the cylinderModel, planeModel, or the sphereModel object.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: plot(model,Color="r") sets the color of the plot to red.

Output axes, specified as gca (the current axes) or axes (a custom set axes) for displaying the visualization.

Color of the plane, specified as a 1-by-3 RGB vector or a short or long color name.

Color NameShort NameRGB TripletAppearance
"red""r"[1 0 0]

Sample of the color red

"green""g"[0 1 0]

Sample of the color green

"blue""b"[0 0 1]

Sample of the color blue

"cyan" "c"[0 1 1]

Sample of the color cyan

"magenta""m"[1 0 1]

Sample of the color magenta

"yellow""y"[1 1 0]

Sample of the color yellow

"black""k"[0 0 0]

Sample of the color black

"white""w"[1 1 1]

Sample of the color white

Output Arguments

collapse all

Handle to a plot, returned as a surf 3-D shaded surface plot or as a patch filled polygon region.

Version History

Introduced in R2015b