Once created, the plot type names are visible in the Settings window of each plot. In addition to the properties modified by the examples below, in the
Settings window of these plot types, you can see the number of geometric entities created, such as number of points, line segments, and triangles. Just as for other types of plots, you can also change the
Range of color and data, as well as
Coloring and Style.
creates a 2D Plot Group using the newly created unique tag. The second argument to
create defines the dimension of the plot group (2 for 2D, 3 for 3D, and so on).
creates a plot of the type PointData. This plot type is only available through methods.
The middle part of the example code generates the points making up the circle. The point coordinates are stored in the 2-by-
N array
p, along with color data in the array
color of length
N. The color data is, in this example, simply based on the index of the points and is used to control the coloring of each point based on a color table.
The property pointdata takes the
2-by-
N array
p as its input. The options for the
coloring property are
colortable or
uniform.
To learn about the syntax for the additional properties available for a Point Data plot, you can run the above code in a blank model, browse to the
Settings window for the
Point Data plot, click
Record Code, and change the corresponding plot properties. Note that the name of the plot type in the
Settings window of the plot in the model tree is
Point Data.
has the second argument set to 3 in order to create a
3D Plot Group. In 3D, the point coordinates,
p is a
3-by-
N array.
creates a plot of the type LineData. This plot type is only available through methods. Just as for
Point Data plots, the point coordinates
p is a
3-by-
N array. In addition to
pointdata, the
LineData plot type takes
elementdata as its input. In the example, this is represented by the
2-by-
N array
t and contains indexes to the columns of
p, corresponding to the start and end points of the lines.
creates a plot of the type SurfaceData. This plot type is only available through methods. Just as for 2D
Point Data plots, the point coordinates
p is a
2-by-
N array. In addition to
pointdata, and similar to the
LineData plot type, the
SurfData plot type takes
elementdata as its input. In the example, this is represented by the
3-by-
N array
t and contains indexes to the columns of
p, corresponding to the vertexes of the triangles. The ordering of the point indexes in the array
t is not important for 2D Surface Data plots.
This example is similar to “Triangulated Shape in 2D” on page 163, but with the point array being a
3-by-
N array for 3D surfaces. For
Surface Data plots in 3D, the ordering of the indexes in the
elementdata array
t matters. It determines the direction of the surface normal, which is used for the lighting effect when using
Scene Light in the
Graphics window. The surface normal of a triangle is determined according to the “right-hand rule”. In mathematical terms, the surface normal is defined as the vector product:
where the indexes into t represent the rows in one of the columns of
t and
p represents a column in the array of points
p.
In this example, information about the surface normal direction is not given implicitly by the triangle orientation, but instead explicitly by the parameter normaldata by means of the
3-by-
Nx*Ny array
normals containing surface normal vectors at each point. The normal vectors do not need to be normalized; only the direction is used. The coloring of the sphere is based on the
z-coordinate of each triangle point and is stored for each point in the
3-by-
Nx*Ny array
color.
A Tube Data plot is similar to a
Point Data, plot but with an absolute
radius array given as an argument to
radiusdata. For the
Point Data plot type, there is a similar
sphereradiusscale.
An Arrow Data plot associates an array of vectors, in the example
vec, to each point
p.
The property pos takes as its input an array of length 2 representing 2D coordinates for the position of the string to be rendered. The property
text takes as its input the string to be rendered. The Boolean property
showpoint determines if a point, at the 2D coordinate position, should be rendered or not.
The Boolean property latexmarkup determines if the text should be interpreted using LaTeX syntax or not.