Sample 24915: Label data points with CBOX and CBORDER
/*****************************************************/
/* This sample program uses the CBOX and CBORDER */
/* annotate variables with the Annotate Facility to */
/* blank out an area so that text and symbols can be */
/* more visible on a graph. */
/*****************************************************/
goptions reset=all ftext=swiss;
/* Define a data set for plotting */
data a;
input MONTH SALES;
datalines;
1 52
2 16
3 78
4 14
5 26
6 31
7 92
8 19
9 18
10 22
11 84
12 93
;
/* Define an annotate data set */
data anno;
/* Set the length of variables */
length function text color $8;
/* Use the data coordinate system, position above and right aligned */
/* apply annotation after procedure output */
retain xsys ysys '2' position '1' when 'a';
set a;
/* Label the data point */
function='label'; x=month; y=sales; text=left(put(sales,2.));
/* Specify a yellow box with a red outline */
cbox='yellow'; cborder='red'; color='black';
run;
/* Define the symbol to be used */
symbol1 i=j v=dot c=black;
title1 'The CBOX and CBORDER Variables';
/* Define the axis statement */
axis1 offset=(2,2) minor=none;
/* Plot the data using annotate to label the points */
proc gplot data=a;
plot SALES*MONTH / anno=anno haxis=axis1 vaxis=axis1 noframe;
run;
quit;

This sample program uses the CBOX and CBORDER annotate variables with the Annotate Facility to blank out an area so that text and symbols can be more visible on a graph.
| Type: | Sample |
| Topic: | SAS Reference ==> Procedures ==> GPLOT Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Elements ==> Labels
|
| Date Modified: | 2005-08-31 03:03:14 |
| Date Created: | 2004-11-11 11:07:59 |
Operating System and Release Information
| SAS System | SAS/GRAPH | All | 8 TS M0 | n/a |