Sample 24936: Represent tick mark values on an axis with a special symbol
This program uses the GFONT procedure to create the square root symbol with a user defined font, then uses the Annotate facility to display the symbol on the horizontal axis of PROC GPLOT output.
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 program uses the GFONT procedure to create the square root symbol with a user defined font, then uses the Annotate facility to display the symbol on the horizontal axis of PROC GPLOT output.
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;
/* Make sure to point the LIBREF of GFONT0 to an */
/* existing directory that you have write access */
/* to in order to create the font catalog. */
libname gfont0 'c:\temp';
/* This data set will be used with PROC GFONT */
/* to create the square root symbol. */
data mymarker;
length ptype char lp $ 1;
input char ptype x y segment lp;
datalines;
A V 0 34 1 L
A V 4 34 1 L
A V 20 0 1 L
A V 30 64 1 L
A V 80 64 1 L
;
run;
proc gfont data=mymarker
name=mymarker
baseline=0
capline=64
charspacetype=none
filled
mwidth=80
nodisplay
resol=2
showroman;
run;
/* Create a sample data set */
data a;
input Real_X Yvar;
datalines;
1 10
2 20
3 30
4 10
5 65
;
run;
/* Create an annotate data set which uses the new MYMARKER */
/* font created with the PROC GFONT step above. */
data anno;
length text $ 8 style $ 25;
retain xsys '2' ysys '3' function 'label';
set a;
x=real_x; y=12;
style='mymarker'; text='A';
size=1.75; position='8';
output;
x=real_x; y=11;
style="'Albany AMT'";
text=left(put(real_x,2.0));
size=1.3; position='9';
output;
run;
symbol1 interpol=join value=dot color=vibg height=1.3;
axis1 value=none origin=( ,14)pct order=(1 to 5 by 1)
offset=(5,5)pct label=none minor=none;
axis2 minor=none;
title1 'Square Root of X';
/* Create the graph using the ANNO= option */
/* on the PLOT statement of PROC GPLOT. */
proc gplot data=a;
plot yvar * real_x / anno=anno haxis=axis1 vaxis=axis2;
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 program uses the GFONT procedure to create the square root symbol with a user defined font, then uses the Annotate facility to display the symbol on the horizontal axis of PROC GPLOT output.
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> GPLOT Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Elements ==> Symbols/Interpolation Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Elements ==> Annotation
|
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 |