auto_xy_SetStyleAttribsΒΆ
auto_xy_SetStyleAttribs sets the line and/or marker style, color, etc. without using the style file.
- bool = auto_xy_SetStyleAttribs(hData, PropName, PropValue)
- bool = auto_xy_SetStyleAttribs(hData, PropName, PropValue, PropName, PropValue)
Return Value
bool is TRUE (1) if the function was successful, otherwise FALSE (0).
Parameters
- hData
hData is the handle of a 1D or 2D dataset. The handle is returned by the function auto_LoadDataset.
- PropName
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
PropValue is a vector with attribute values.
- Line
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)
- Marker
For the value PropName =
"Marker"
the vector has 9 or 10 elements:Value
Meaning
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.
Markertyp
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
MS_PLUS
Plus sign
MS_CROSS
Cross
MS_SIMPLESTAR
Star
MS_CIRCLE
Circle
MS_RECTANGLE
Rectangle
MS_DIAMOND
Diamond
MS_TRIANGLE
Triangle
MS_TRIANGLE1
Triangle turned 90 degrees
MS_TRIANGLE2
Triangle turned 180 degrees
MS_TRIANGLE3
Triangle turned 270 degrees
MS_HOURGLASS
Hourglass (2 triangles)
MS_HOURGLASS1
Hourglass turned 90 degrees
MS_STAR
Star
MS_CIRCLEDOT
Circle with dot
MS_CIRCLEPLUS
Circle with Plus sign
MS_CIRCLECROSS
Circle with cross
MS_RECTDOT
Rectangle with dot
MS_RECTPLUS
Rectangle with plus sign
MS_RECTCROSS
Rectangle with cross
MS_NULL
Invisible Marker
MS_DOT
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