SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 1 Vol 2

SEGMENT COLOR

Name:
    SEGMENT ... COLOR
Type:
    Plot Control Command
Purpose:
    Specifies the color for the line segments to appear on subsequent plots.
Description:
    Segments are straight lines that the analyst can position anywhere on the plot. The segments appear on all subsequent plots until blanked out or overridden with new segment coordinates. The segment colors hold for all subsequent plots until defaulted or overridden with new colors. Up to 100 such line segments can be specified.

    Segments are most typically used in legend boxes to identify curves. Dataplot provides two methods for specifying colors.

    1. Colors can be defined by name (or by the corresponding index). Dataplot adopted it's named colors from the X11 project. Currently, 162 named colors and 100 levels of grayscale are supported. Grayscale can be specified with either G0, G1, ..., G100 (or -1, -2, ..., -100). Many older devices support only a limited number of colors. For these devices, unsupported colors will be mapped to one of the available colors. To specify a named color, see Syntax 1.

    2. Most modern graphics devices support full RGB (RedBlueGreen) color. You can alternatively specify RGB colors by entering three integer values to represent the Red, Green and Blue components, respectively. These values should be in the range 0 to 255.

    When setting the segment RGB color, Dataplot first checks if the device supports RGB colors. If not, the named color will be used. If the device does support RGB color, Dataplot will check if an RGB color has been specified. If yes, then that RGB color is used. If not, the named color will be used.

    To see the list of supported named colors (with the associated index number), see

    https://www.itl.nist.gov/div898/software/dataplot/refman1/ch11/homepage.htm

Syntax 1:
    SEGMENT <id> COLOR <color>
    where <id> is an integer number or parameter in the range 1 to 100 that specifies the segment identifier;
    and     <color> is a character string or index number that specifies the desired color.
Syntax 2:
    SEGMENT <id> RGB COLORS <red> <green> <blue>
    where <id> is an integer number or parameter in the range 1 to 100 that specifies the segment identifier;
                <red> is a number or parameter that specifies the red component;
                <green> is a number or parameter that specifies the green component;
    and     <blue> is a number or parameter that specifies the blue component.

    To turn off the RGB color, set the values to -1 (any negative value will work). Values greater than 255 will be set to 255.

Examples:
    SEGMENT 2 COLOR GREEN
    SEGMENT 2 COLOR BLUE
Note:
    A SEGMENT ... COLOR command with no arguments reverts the line segment color to default; thus SEGMENT 1 COLOR with no arguments reverts the color for line segment 1 to default. A SEGMENT ... COLOR command with no <id> refers to all 100 line segments; thus SEGMENT COLOR GREEN assigns the color green to all 100 line segments. SEGMENT COLOR with no <id> and no arguments reverts the color to default for all 100 line segments.
Default:
    All line segments are drawn in black.
Synonyms:
    None
Related Commands: Applications:
    Presentation Graphics
Implementation Date:
    Pre-1987
    2020/11: Support for RGB colors
Program 1:
     
    . POLLUTION SOURCE ANALYSIS, LLOYD CURRIE, DATE--1990
    . SUBSET OF CURRIE.DAT REFERENCE FILE
    .
    SERIAL READ LEAD
    164 426 59 98 312 263 607 497 213 54 160 262 547 325 419 94 70
    END OF DATA
    SERIAL READ POT
    106 175 61 79 94 121 424 328 107 218 140 179 246 231 245 339 99
    END OF DATA
    LET N = SIZE LEAD; LET X = SEQUENCE 1 1 N
    .
    LINE COLOR RED BLUE
    LINE THICKNESS 0.3 ALL
    SEGMENT 1 COORDINATES 17 87 22 87
    SEGMENT 2 COORDINATES 17 83 22 83
    SEGMENT 1 COLOR RED
    SEGMENT 2 COLOR BLUE
    SEGMENT THICKNESS 0.3
    LEGEND 1 COORDINATES 23 86
    LEGEND 1 POTASSIUM
    LEGEND 2 COORDINATES 23 82
    LEGEND 2 LEAD
    TITLE DEMONSTRATE SEGMENT COLOR
    PLOT POT LEAD VS X
        
    plot generated by sample program
Program 2:
     
    . POLLUTION SOURCE ANALYSIS, LLOYD CURRIE, DATE--1990
    . SUBSET OF CURRIE.DAT REFERENCE FILE
    .
    SERIAL READ LEAD
    164 426 59 98 312 263 607 497 213 54 160 262 547 325 419 94 70
    END OF DATA
    SERIAL READ POT
    106 175 61 79 94 121 424 328 107 218 140 179 246 231 245 339 99
    END OF DATA
    LET N = SIZE LEAD; LET X = SEQUENCE 1 1 N
    .
    LINE COLOR RED BLUE
    LINE RGB COLOR 220 109 88 175 238 238
    LINE THICKNESS 0.3 ALL
    SEGMENT 1 COORDINATES 17 87 22 87
    SEGMENT 2 COORDINATES 17 83 22 83
    SEGMENT 1 COLOR RED
    SEGMENT 2 COLOR BLUE
    SEGMENT 1 RGB COLOR 220 109 88
    SEGMENT 2 RGB COLOR 175 238 238
    SEGMENT THICKNESS 0.3
    LEGEND 1 COORDINATES 23 86
    LEGEND 1 POTASSIUM
    LEGEND 2 COORDINATES 23 82
    LEGEND 2 LEAD
    TITLE DEMONSTRATE SEGMENT RGB COLOR
    PLOT POT LEAD VS X
        
    plot generated by sample program

Privacy Policy/Security Notice
Disclaimer | FOIA

NIST is an agency of the U.S. Commerce Department.

Date created: 05/13/2021
Last updated: 05/13/2021

Please email comments on this WWW page to alan.heckert@nist.gov.