ArrowData
Create an arrow data plot.
Syntax
model.result(<pgtag>).create(<ftag>,"ArrowData");
model.result(<pgtag>).feature(<ftag>).set(property, <value>);
model.result(<pgtag>).feature(<ftag>).run();
Description
model.result(<pgtag>).create(<ftag>,"ArrowData") creates an arrow data plot feature named <ftag> belonging to the 2D or 3D plot group <pgtag>.
Arrow data plots are used to visualize raw vector data given as points, vectors, and colors (see the example below). Arrow data plots can be added to 2D and 3D plot groups.
The following properties are available:
head | tail|
center
normalized | proportional | logarithmic
arrow | arrowhead | cone
custom | black | blue | cyan | gray | green | magenta | red | white | yellow
custom | black | blue | cyan | gray | green |magenta | red | white | yellow
A color calibration value (-1.5 to 1.5) when colortabletrans is set to nonlinear or nonlinearsymmetric.
colortable | uniform | gradient
on | off
Whether to show color legend when coloring is set to colortable.
linear | linearsymmetric | logarithmic
The color table to use when coloring is set to colortable. See Color Tables for a list of color tables.
none | reverse | nonlinear | nonlinearsymmetric
Transformation of the color table, when coloring is set to colortable or gradient.
{1,0,0} or last used color.
The uniform color to use. Active when bottomcolor is set to custom.
{1,0,0} or last used color.
{1,0,0} or last used color.
The uniform color to use. Active when topcolor is set to custom.
If arrowlength is logarithmic: The ratio between the maximum arrow length and the arrow length below which no arrow is drawn.
on | off
Whether to reverse to color table or gradient when coloring is set to colortable or gradient and colortabletrans is set to nonlinear or nonlinearsymmetric.
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 | label | manual | none
auto, if the title should be computed automatically. label, if the title should be the plot group’s label. manual, if the manual title should be used (the title property). none, if no title should be displayed.
custom | black | blue | cyan | gray | green | magenta | red | white | yellow
Attributes
None.
Example
A method for creating an arrow circle in 2D.
Code for Use with Java
String pgTag = model.result().uniquetag("pg");
ResultFeature pg = model.result().create(pgTag, 2);
ResultFeature plot = pg.create("arrow1", "ArrowData");
int N = 17;
double[][] p = new double[2][N];
double[][] vec = new double[2][N];
double len = 0.2;
for (int i = 0; i < N; i++) {
double angle = 2*Math.PI*i/N;
p[0][i] = Math.cos(angle);
p[1][i] = Math.sin(angle);
vec[0][i] = -len*p[0][i];
vec[1][i] = -len*p[1][i];
}
plot.set("pointdata", p).set("vectordata", vec);
A method for creating a 3D logarithmic arrow spiral.
Code for Use with Java
String pgTag = model.result().uniquetag("pg");
ResultFeature pg = model.result().create(pgTag, 3);
ResultFeature plot = pg.create("arrow1", "ArrowData");
int N = 1000;
double[][] p = new double[3][N];
double[][] vec = new double[3][N];
double[] color = new double[N];
for (int i = 0; i < N; i++) {
double par = 0.005*i;
p[0][i] = Math.exp(par)*Math.cos(10*par);
p[1][i] = Math.exp(par)*Math.sin(10*par);
p[2][i] = 0.1*i;
double len = Math.sqrt(p[0][i]*p[0][i]+p[1][i]*p[1][i]+p[2][i]*p[2][i]);
for (int j = 0; j < 3; j++) {
vec[j][i] = 4*p[j][i]/len;
}
color[i] = i;
}
plot.set("pointdata", p)
.set("vectordata", vec)
.set("colordata", color)
.set("coloring", "colortable");
See Also
AnnotationData, LineData, PointData, SurfaceData, TubeData