LineData
Create a line data plot.
Syntax
model.result(<pgtag>).create(<ftag>,"LineData");
model.result(<pgtag>).feature(<ftag>).set(property, <value>);
model.result(<pgtag>).feature(<ftag>).run();
Description
model.result(<pgtag>).create(<ftag>,"LineData") creates a line data plot feature named <ftag> belonging to the 2D or 3D plot group <pgtag>.
Line data plots are used to visualize raw point data given as points, elements, and colors as line segments (see the examples below). Line data plots can be added to 2D and 3D plot groups.
The following properties are available:
custom | black | blue | cyan | gray | green |magenta | red | white | yellow
colortable | uniform
on | off
Whether to show color legend when coloring is set to colortable.
The color table to use when coloring is set to colortable. See Color Tables for a list of color tables.
on | off
Whether to reverse to color table when coloring is set to colortable
on | off
on | off
Whether to use the manual color range specified in rangecolormin and rangecolormax. The color range specifies the minimum and maxim value in the plotted colors. Default is the minimum and maximum data values.
on | off
Whether to use the manual data range specified in rangedatamin and rangedatamax. Values outside the data range are not plotted.
The title to use when titletype is manual.
auto | manual | none
auto if the title contribution should be computed automatically. manual if the manual title contribution should be used (the title property). none if no title contribution should be used.
Attributes
None.
Examples
A method for creating a line data plot in 2D for data representing a sine curve (x, sin(x)):
Code for Use with Java
ResultFeature pg = m.result().create("pg1", 2);
ResultFeature plot = pg.create("line1", "LineData");
int N = 100;
double[][] p = new double[2][N];
int[][] t = new int[2][N - 1];
double[] color = new double[N];
for (int i = 0; i < N; i++) {
double x = 4 * Math.PI * i / N;
p[0][i] = x;
p[1][i] = Math.sin(x);
if (i > 0) {
t[0][i - 1] = i - 1;
t[1][i - 1] = i;
}
}
plot.set("pointdata", p)
.set("elementdata", t)
.set("colordata", color);
plot.run();
A method for creating a line data plot in 3D for data representing a curve (x, x1.3, x1.6):
Code for Use with Java
pg = m.result().create("pg2", 3);
plot = pg.create("line1", "LineData");
p = new double[3][N];
t = new int[2][N - 1];
color = new double[N];
for (int i = 0; i < N; i++) {
p[0][i] = i;
p[1][i] = Math.pow(i, 1.3);
p[2][i] = Math.pow(i, 1.6);
if (i > 0) {
t[0][i - 1] = i - 1;
t[1][i - 1] = i;
}
}
plot.set("pointdata", p)
.set("elementdata", t)
.set("colordata", color);
plot.run();
See Also
AnnotationData, ArrowData, PointData, SurfaceData, TubeData