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

  1. MS_PLUS

Plus sign

  1. MS_CROSS

Cross

  1. MS_SIMPLESTAR

Star

  1. MS_CIRCLE

Circle

  1. MS_RECTANGLE

Rectangle

  1. MS_DIAMOND

Diamond

  1. MS_TRIANGLE

Triangle

  1. MS_TRIANGLE1

Triangle turned 90 degrees

  1. MS_TRIANGLE2

Triangle turned 180 degrees

  1. MS_TRIANGLE3

Triangle turned 270 degrees

  1. MS_HOURGLASS

Hourglass (2 triangles)

  1. MS_HOURGLASS1

Hourglass turned 90 degrees

  1. MS_STAR

Star

  1. MS_CIRCLEDOT

Circle with dot

  1. MS_CIRCLEPLUS

Circle with Plus sign

  1. MS_CIRCLECROSS

Circle with cross

  1. MS_RECTDOT

Rectangle with dot

  1. MS_RECTPLUS

Rectangle with plus sign

  1. MS_RECTCROSS

Rectangle with cross

  1. MS_NULL

Invisible Marker

  1. 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();
}

id-61470