Sample 24937: Create a time line plot with PROC GPLOT and Annotate
This sample program uses PROC GPLOT with the Annotate facility to generate a time line plot.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample program uses PROC GPLOT with the Annotate facility to generate a time line plot.
The graphics output in the Results tab was produced using SASĀ® 9.2. Submitting the sample code with releases of SAS prior to SAS 9.2 might produce different results.
/* Set the graphics environment */
goptions reset=all cback=white border htitle=12pt htext=10pt;
/* Create a sample data set */
data a;
input Material $ Start Stop Linetype;
datalines;
A 4 7 1
B 1 6 2
C 3 9 1
D 2 8 2
E 1 7 1
;
run;
/* Create the annotate data set to use with */
/* PROC GPLOT. */
data anno;
length function color $8;
retain xsys ysys '2' size 2 color 'vibg';
set a;
line=linetype;
function='move';
x=start; yc=Material;
output;
function='draw';
x=stop; yc=Material;
output;
run;
axis1 order=(0 to 10) label=('Start - Stop') minor=none;
symbol1 interpol=none value=none;
/* Add a title to the graph */
title1 'Time Line';
/* Create the graph using the ANNO= */
/* option on the PLOT statement. */
proc gplot data=a;
plot Material*stop / anno=anno haxis=axis1;
run;
quit;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample program uses PROC GPLOT with the Annotate facility to generate a time line plot.
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> GPLOT Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Elements ==> Annotation Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Types ==> Plots ==> Other Plots
|
Date Modified: | 2005-08-31 03:03:22 |
Date Created: | 2004-11-11 11:08:03 |
Operating System and Release Information
SAS System | SAS/GRAPH | All | n/a | n/a |