Sample 25586: Specifying GPRINT color text
Overview
This example creates the REFLIB.DOWHLC data set and generates a graph with color text from output that is produced by the TIMEPLOT procedure. The second part of this example takes the output generated by the TIMEPLOT procedure and converts it to a graph by using the GPRINT procedure.
This sample is from the "SAS/GRAPH Software: Reference, Version 8", Volume 2, Chapter 22.
For additional information on the sample refer to this book.
/*+-------------------------------------------------------------+
| S A S S A M P L E L I B R A R Y |
| |
| NAME: GPRCOLOR |
| TITLE: GPRCOLOR-Specifying GPRINT Color Text |
| PRODUCT: GRAPH |
| SYSTEM: ALL |
| KEYS: GRAPHICS GOPTIONS GPRINT FORMAT |
| PROCS: GPRINT PRINTTO TIMEPLOT |
| DATA: INTERNAL |
| |
| SUPPORT: GRAPHICS STAFF UPDATE: |
| REF: SAS/GRAPH REFERENCE GUIDE |
| MISC: THIS PROGRAM NEEDS A FILENAME ALLOCATION. |
+-------------------------------------------------------------+*/
/* Set the graphics environment */
goptions reset=all border cback=white
colors=(black blue green red)
ftitle=swissb htitle=3pct
htext=.8 ftext=none
hsize=7in vsize=5in;
/* Assign the fileref OUT to the external file */
*filename out 'external-file';
/* Create the data set DOWHLC */
data dowhlc;
input date date9. high low close;
format date date9.;
datalines;
02JAN1997 6511.38 6318.96 6442.49
03JAN1997 6586.42 6437.10 6544.09
06JAN1997 6647.22 6508.30 6567.18
07JAN1997 6621.82 6481.75 6600.66
08JAN1997 6650.30 6509.84 6549.48
09JAN1997 6677.24 6520.23 6625.67
10JAN1997 6725.35 6530.62 6703.79
13JAN1997 6773.45 6647.99 6709.18
14JAN1997 6816.17 6689.94 6762.29
15JAN1997 6800.77 6669.93 6726.88
16JAN1997 6818.47 6688.40 6765.37
17JAN1997 6863.88 6732.66 6833.10
20JAN1997 6839.13 6777.30 6843.87
21JAN1997 6934.69 6771.14 6883.90
22JAN1997 6913.14 6801.16 6850.03
23JAN1997 6953.55 6724.19 6755.75
24JAN1997 6798.08 6629.91 6696.48
27JAN1997 6748.82 6598.73 6660.69
28JAN1997 6823.48 6612.20 6656.08
29JAN1997 6673.39 6627.98 6740.74
30JAN1997 6845.03 6719.96 6823.86
31JAN1997 6912.37 6769.99 6813.09
;
/* Suppress the date line and page numbers */
/* Set linesize and pagesize */
options nodate nonumber linesize=80 pagesize=60;
/* Specify the destination for all */
/* subsequent procedure output */
proc printto print=out new;
run;
/* Generate TIMEPLOT graph */
/* Output is sent to external file */
proc timeplot data=dowhlc;
plot low close high / overlay hiloc ref=mean(low)
npp axis=6310 to 6960 by 10;
id date;
run;
/* Reset destination for printed output to default */
proc printto;
run;
/* Define title and footnote */
title 'TIMEPLOT of Dow-Jones Averages';
footnote h=3 pct f=swiss
j=l ' L=Low' ' C=Close' ' H=High'
j=r 'GPRCOLOR ';
/* Generate graph from the external file */
/* Specify text color */
proc gprint fileref=out ctext=red;
run;
quit;

This example creates the REFLIB.DOWHLC data set and generates a graph with color text from output that is produced by the TIMEPLOT procedure. The second part of this example takes the output generated by the TIMEPLOT procedure and converts it to a graph by using the GPRINT procedure.
| Type: | Sample |
| Topic: | SAS Reference ==> Procedures ==> GPRINT
|
| Date Modified: | 2005-09-23 03:03:02 |
| Date Created: | 2005-05-23 14:17:16 |
Operating System and Release Information
| SAS System | SAS/GRAPH | All | 8 TS M0 | n/a |