auto_xy_SetStyleAttribs sets the line and/or marker style, color, etc. without using the style file.
Return Value
bool is TRUE (1) if the function was successful, otherwise FALSE (0).
Parameters
hData is the handle of a 1D or 2D dataset. The handle is returned by the function auto_LoadDataset.
PropName is a string with the value "Line" or "Marker". Depending on the value the following parameter PropValue is a vector with 5 or 9 elements.
PropValue is a vector with attribute values.
For the value PropName = "Line" the vector has 5 elements:
Value Meaning rvLine[1] Line style (0 to 5) (see PenCreate) rvLine[2] Line width in steps of 0.1 mm. rvLine[3,4,5] Line color (red, green, blue in the range 0 to 255)
For the value PropName = "Marker" the vector has 9 or 10 elements:
| rvMarker[1] | Marker type (0 to 20) |
| rvMarker[2] | size of the symbol in centimeters |
| rvMarker[3,4,5] | color of the symbol edge (red, green, blue in the range 0 to 255) |
| rvMarker[6,7,8] | fill color (red, green, blue in the range 0 to 255) |
| rvMarker[9] | line width in steps of 0.1 mm. |
| rvMarker[10] | (Option) Filling: 0: Opaque, 1: Transparent, Default is 0. |
The marker style is one of the following values (The number or the alias can be used, e.g. 3 or MS_CIRCLE):
| Value | Meaning |
|---|---|
|
Plus sign |
|
Cross |
|
Star |
|
Circle |
|
Rectangle |
|
Diamond |
|
Triangle |
|
Triangle turned 90 degrees |
|
Triangle turned 180 degrees |
|
Triangle turned 270 degrees |
|
Hourglass (2 triangles) |
|
Hourglass turned 90 degrees |
|
Star |
|
Circle with dot |
|
Circle with Plus sign |
|
Circle with cross |
|
Rectangle with dot |
|
Rectangle with plus sign |
|
Rectangle with cross |
|
Invisible Marker |
|
smallest plotable point |
Example
auto_xy_SetStyleAttribs(hData, "Line", [0, 4, 255, 0, 0], ...
"Marker", [3, 0.15, 0, 0, 0, 255, 0, 0 , 1]);
auto_xy_SetStyleAttribs(hData, "Line", [0, 4, 255, 0, 0]);
auto_xy_SetStyleAttribs(hData, "Marker", [3, 0.15, 0, 0, 0, 255, 0, 0 , 1]);
auto_xy_SetStyleAttribs(hData, "Marker", [MS_CIRCLE, 0.15, 0, 0, 0, 255, 0, 0 , 1]);
rvMarker = [MS_CIRCLE, 0.15, 0, 0, 0, 255, 0, 0 , 1]
auto_xy_SetStyleAttribs(hData, "Marker", rvMarker);
One complete example
auto_AddToUI("Examples", "Example", "RS_Example");
def RS_Example()
{
rmColor = [255,0,0; 0,0,255]; // Red, Blue
auto_SetFileNameDialogInit("*.dat;*.nc");
svFile = auto_GetFileNameDialog(2);
if (svFile[1] == "DLG_CANCEL") {
return;
}
auto_LoadTemplate("Example.ipw");
nFile = len(svFile);
for (i in 1:nFile) {
auto_ImportData(svFile[i]);
hData = auto_LoadDataset("Diagramm 1", "Zeitkanal", "LAMBDA");
auto_xy_SetStyleAttribs(hData, "Line", [0, 4, rmColor[i;]], ...
"Marker", [3, 0.15, 0, 0, 0 ,rmColor[i;], 1]);
hData = auto_LoadDataset("Diagramm 2", "Zeitkanal", "TMOT");
auto_xy_SetStyleAttribs(hData, "Line", [0, 4, rmColor[i;]]);
}
auto_ScaleAxes();
auto_UpdatePage();
}
See also
Overview Automation, auto_LoadDataset, PenCreate, MarkerCreate, XYSetStyle, XYSetPen, XYSetMarker
id-61470