Doing More with Graphics |
To change the background color and add various other features to graphs, you use prefix and suffix commands as described in these steps.
To display the Device Driver Prefix Commands window, follow this selection path:Tasks Setup Environment Graphics options Active graphics device
The Active Graphics Device window appears.
Select Driver Management from the Active Graphics Device window. The Device Driver Management window appears.
Select Supplemental commands from the Device Driver Management window. The Device Driver Supplemental Commands window appears.
Select Prefix commands from the Device Driver Supplemental Commands window. The Prefix Commands window appears.
Prefix Commands Window
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.
Follow this selection path: File CloseA prompt appears asking if you want to save the changes; select Yes.
Select Suffix commands; the Device Driver Suffix Commands window appears.
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.
Follow this selection path: File CloseA prompt appears asking if you want to save the changes; select Yes.
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.
Copyright © 2012 by SAS Institute Inc., Cary, NC, USA. All rights reserved.