Previous Page | Next Page

Doing More with Graphics

Changing the Background Color for Graphs

To change the background color and add various other features to graphs, you use prefix and suffix commands as described in these steps.

  1. To display the Device Driver Prefix Commands window, follow this selection path:Tasks [arrow] Setup [arrow] Environment [arrow] Graphics options [arrow] Active graphics device

    The Active Graphics Device window appears.

  2. Select Driver Management from the Active Graphics Device window. The Device Driver Management window appears.

  3. Select Supplemental commands from the Device Driver Management window. The Device Driver Supplemental Commands window appears.

  4. Select Prefix commands from the Device Driver Supplemental Commands window. The Prefix Commands window appears.

    Prefix Commands Window

    [Prefix Commands Window]

  5. Type

    goptions cback=color;

    where color is one of the following:

    black lilac rose
    blue lime salmon
    brown magenta steel
    charcoal maroon tan
    cream olive violet
    cyan orange white
    gold pink yellow
    gray purple
    green red

    In the Prefix Commands window, you type the SAS statements or system-specific commands that you want to use. In this step, you use a prefix command to change the background color of your graphic. In the next step, you use a suffix command to reset the color to the default after the chart has been displayed and printed.

    The prefix and suffix commands remain in effect and are associated with the active graphics device until you change them, even after you end your SAS session. Therefore, if you change the background color for a graph, each graph you create with that driver uses the new background color until you change the prefix command.

    When you set up prefix and suffix commands, a catalog entry of dev.SOURCE is created for prefix commands, and a catalog entry of dev.OUTPUT is created for suffix commands, where dev is the device driver. If the GDEVICE0 libref has been assigned to your personal device driver catalog, the catalog entries are created in your SASUSER.PROFILE catalog and the catalog is referenced by GDEVICE0. If GDEVICE0 has not been assigned, the entries are created only in your SASUSER.PROFILE catalog.

  6. Follow this selection path: File [arrow] CloseA prompt appears asking if you want to save the changes; select Yes.

  7. Select Suffix commands; the Device Driver Suffix Commands window appears.

  8. Type

    goptions cback=;

    to reset the background color to the default. Resetting the background color ensures that when you select different drivers in the same SAS session, the prefix commands of any previously selected drivers are not in effect.

  9. Follow this selection path: File [arrow] CloseA prompt appears asking if you want to save the changes; select Yes.

  10. Select Goback twice, then OK to return to the WorkPlace menu.

    Note:   To clear the prefix and suffix commands, access the Device Driver Prefix Commands window and Device Driver Suffix Commands window as described above. Delete the commands, then select Close from the File menu for each window.  [cautionend]

Previous Page | Next Page | Top of Page