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

LEGEND COLOR

Name:
    LEGEND ... COLOR
Type:
    Plot Control Command
Purpose:
    Specifies the color of the legends to appear on subsequent plots.
Description:
    The legends are the text which the analyst can position anywhere (via the LEGEND ... COORDINATES command) on a plot. The legends appear on all subsequent plots until blanked out (via a LEGEND command with no arguments) or until overridden with new legends. 100 such legends can be specified.

    The legend colors hold for all subsequent plots until defaulted (via the LEGEND ... COLOR command with no arguments) or until overridden with new legend colors.

    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 legend 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:
    LEGEND <id> COLOR <color>
    where <id> is an integer number or parameter in the range 1 to 100 that specifies the legend identifier;
    and     <color> is the desired legend color.
Syntax 2:
    LEGEND <id> RGB COLORS <red> <green> <blue>
    where <id> is an integer number or parameter in the range 1 to 100 that specifies the legend identifier;
                <red> is a number or parameter that specifies the red component;
                <green> is a number or parameter that specifies the green component;
                <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:
    LEGEND 1 COLOR YELLOW
    LEGEND 2 COLOR BLACK
    LEGEND 1 COLOR
    LEGEND COLOR
    LEGEND 1 RGB COLOR 220 109 88
    LEGEND 2 RGB COLOR 175 238 238
Note:
    A LEGEND ... COLOR command with no color reverts the color to default. Thus LEGEND 1 COLOR with no color reverts the color of legend 1 to default. A LEGEND ... COLOR command with no <id> refers to all 100 legends. Thus LEGEND COLOR BLUE assigns the color BLUE to all 100 legends. LABEL COLOR with no <id> and no color reverts all 100 legends to the default color.
Default:
    All legend colors are black.
Synonyms:
    None
Related Commands: Applications:
    Presentation Graphics
Implementation Date:
    Pre-1987
    2020/10: Support for RGB colors
Program 1:
     
    . POLLUTION SOURCE ANALYSIS, LLOYD CURRIE, DATE--1990
    . SUBSET OF CURRIE.DAT REFERENCE FILE
    .
    LET ID2 = DATA 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2
    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
    .
    CHARACTER X1 X2 Y1 Y2
    CHARACTER COLOR RED RED BLUE BLUE
    LINE BLANK ALL
    LEGEND 1 X - POTASSIUM
    LEGEND 2 Y - LEAD
    LEGEND 1 COLOR RED
    LEGEND 2 COLOR BLUE
    .
    TITLE DEMONSTRATE LEGEND COLOR COMMAND
    LET X = SEQUENCE 1 1 17
    PLOT POT X ID2 AND
    PLOT LEAD X ID2
        
    plot generated by sample program
Program 2:
     
    . POLLUTION SOURCE ANALYSIS, LLOYD CURRIE, DATE--1990
    . SUBSET OF CURRIE.DAT REFERENCE FILE
    .
    LET ID2 = DATA 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2
    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
    .
    CHARACTER X1 X2 Y1 Y2
    CHARACTER COLOR RED RED BLUE BLUE
    LINE BLANK ALL
    LEGEND 1 X - POTASSIUM
    LEGEND 2 Y - LEAD
    LEGEND 1 COLOR RED
    LEGEND 2 COLOR BLUE
    LEGEND 1 RGB COLOR 220 109 88
    LEGEND 2 RGB COLOR 175 238 238
    .
    TITLE DEMONSTRATE LEGEND RGB COLOR COMMAND
    LET X = SEQUENCE 1 1 17
    PLOT POT X ID2 AND
    PLOT LEAD X ID2
        
    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.