Sample 24934: Use superscripts and subscripts with SAS/GRAPH® output
The sample code on the Full Code tab uses the MOVE= (or M=) option in SAS/GRAPH TITLE and NOTE statements to add superscript and subscript characters to SAS/GRAPH output. With this method, some trial and error is needed to position the characters in the correct location on the graph.
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.
The graphics output on 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.
/* Create sample data */
data a;
input x y;
datalines;
1 25.6
2 37.2
3 18.5
4 43.5
5 58.3
;
run;
/* Set the graphics environment */
goptions reset=all border htitle=12pt htext=10pt;
symbol1 interpol=none value=dot color=CX7C95CA height=1.7;
axis1 label=(height=3 pct ' ') minor=none offset=(3pct,3pct);
axis2 label=(angle=90 height=10 pct ' ') minor=none;
title1 height=12pt ' ';
/* Add a superscript to the title */
title2 height=13pt 'Superscripts and Subscripts' move=(+.3,+1) height=11pt '(1)';
/* Add extra white space below the graph */
footnote1 height=20pt ' ';
footnote2 height=12pt angle=90 ' ';
/* Create the graphics output */
proc gplot;
plot y*x / haxis=axis1 vaxis=axis2;
/* Horizontal axis label */
note font='Albany AMT/bold'
move=(50,5)pct height=13pt 'H' move=(+.5,-.75) height=11pt '2'
move=(+.8,+.75) height=13pt 'O' move=(+.5,+.75) height=11pt '2';
/* Vertical axis label */
note font='Albany AMT/bold'
move=(5,60)pct height=13pt 'N' move=(+.5,+.75) height=11pt '2';
note font='Albany AMT/bold'
move=(5,55)pct height=13pt 'H' move=(+.5,-.75) height=11pt '2';
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 uses the MOVE= option to add superscript and subscript characters to SAS/GRAPH output.
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> GPLOT
|
Date Modified: | 2005-08-31 03:03:21 |
Date Created: | 2004-11-11 11:08:03 |
Operating System and Release Information
SAS System | SAS/GRAPH | All | n/a | n/a |