title1 h=2 f=duplex j=c 'Using the MOVE option, within a NOTE statement'; proc gslide; .... example, Figure 8 has the de
Graphing: Taking the Mystery out of Subscripts and Superscripts (The Why Not’s and How To’s are Presented) Lori D. Griffin, Hoechst Marion Roussel, Inc., Kansas City, MO
superscipting. The first three sections are concerning the title, footnote and note statements, these three sections are more closely related as far as the code required for sub/superscripting. The next two sections cover axis labels and axis values, these sections are probably the most interesting, because it covers useful techniques that are more complex then the previous sections. The final section labeled other alternative methods covers other methods available when sub/superscripting.
ABSTRACT This paper covers several different areas of a graph where subscripting and superscripting may occur. For example, when graphing, have you ever had a title that needed a superscripted character or a footnote that needed a subscripted character added? Maybe you need to add a note statement that has a character that is superscripted. There are other areas of a graph, like axis values and axis labels that might also contain a subscripted or superscripted character.
TITLES
The intent of this paper is to illustrate the differences in your code that exist when adding subscripts or superscripts to titles, footnotes, notes, axis labels and axis values. Some of these labeling areas of the graph require alternative graphing techniques in order to accomplish the task of subscripting or superscripting.
The easiest way to add a sub/superscript to a title is to use the MOVE= option. See the following title statement which contains a MOVE= option to apply a subscipted value of PD20 to the graph. Figure 1 displays the results of the subscripted title statement.
TITLE1 H=1.2 F=duplex J=C ’Log Ratio of PD’ move=(-0,-.3) h=.75 ’20’ move=(+0,+.3) h=1.2 ’, VisitX to Baseline (Mean’ f=math ’G’ f=duplex ’2SE)’ a=90 ’ ’;
INTRODUCTION This paper is intended for all levels of SAS® programmers from the beginner to the more advanced. I believe everyone will learn a technique or two that may come in handy when attempting to add a subscripted or superscipted value to their graph. This presentation has six sections regarding subscripting and 1
FOOTNOTE1 H=1.2 F=&FTTEXT J=L "Note: This ; x=1.8; y=50; text=’Log Ratio of PD’; output; function=’label’; size=.6; x=4; y=.; position=’0’; text=’20’; output; • • • TITLE1 H=1.2 F=duplex J=C ’Log Ratio of PD’ move=(-0,-.3) h=.75 ’20’ move=(+0,+.3) h=1.2 ’, VisitX to Baseline (Mean’ f=math ’G’ f=duplex ’2SE)’ a=90 ’ ’; • • • PROC GPLOT DATA=HILO anno=anno; FORMAT SORT TIMES.; FORMAT NDOSE DOSE.; PLOT VALUE*NDOSE=SORT /HAXIS=AXIS1 VAXIS=AXIS2; LEGEND1 LABEL=NONE; AXIS1 LABEL=(H=1 f=duplex ’Dose’) ORDER=(1 TO 4 BY 1) VALUE=(H=1) OFFSET=(5PCT,5PCT) MINOR=NONE ; AXIS2 LABEL=NONE OFFSET=(5PCT,1PCT) ORDER=(&START TO &FINISH BY &BY) MINOR=NONE;
Subscripted Y-Axis using Annotate
If you are accustomed to and comfortable with using annotate, this method really is not as bad as it looks. However, the title statement is less code and probably easier to use.
5
example, Figure 8 has the degrees symbol (°), for degrees fahrenheit. It looks as though it is superscripted, but instead I have used the special font of ’O’. This is just a reminder that there are a lot of options available, so take a moment and consider your alternatives.
AXIS VALUES The easiest way I have found to subscript or superscript axis values is to use annotate. Figure 7 contains both a subscripted X and Y-axis values. DATA ANNO; %ANNOMAC; LENGTH TEXT $2.; xsys=’5’; YSYS=’2’; %label(3.7,0,’r’,blue,.,., 1.5,duplex,.); %label(5,-.6,’o’,blue,.,.,1, duplex,.); XSYS=’2’; YSYS=’5’; %label(10,12.5,’x’,blue,.,., 1.5,duplex,.); %label(10.35,11.2,’o’,blue,. ,.,1,duplex,.);
Figure 7
Title4 f=duplex h=1.75 ’Plot of Temperature (’ f=special ’0’ f=duplex ’F) over time’;
Subscripting X and Y axis values
Figure 8
Superscript Alternative
Another alternative method available is to reduce the size of the subscripting character and not use the MOVE= option at all. This gives the illusion that the value is subscripted without the MOVE= option. This method is easier but does not truly represent that the value is
OTHER ALTERNATIVE METHODS Just make sure before you get to worried about sub/superscripting that you first investigate your alternatives. For 6
subscripted, but if you are in a hurry and your audience is aware of the meaning then this method would be fine. At a glance Figure 9’s title and Y-axis label looks as though it is subscripted, but if you have a picky person critiquing your graph then you may have a problem. So just a reminder, you should know your audience and their expectations.
CONCLUSION Hopefully, the information presented in this paper will prove beneficial in any endeavors you may encounter concerning subscripting or superscripting.
ACKNOWLEDGMENTS SAS, SAS/GRAPH are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.
TITLE1 H=1.5 f=duplex J=C ’Log Ratio of PD’ h=1 ’20’ h=1.5 ’, VisitX to Baseline (Mean’ f=math ’G’ f=duplex ’2SE)’ a=90 ’ ’ ’Log Ratio of PD’ h=1 ’20’;
Other brand and product names are registered trademarks or trademarks of their respective companies.
AUTHOR INFORMATION Any questions, comments, suggestions contact: Lori Griffin Senior Applications Analyst Database Programming Hoechst Marion Roussel, Inc. 10236 Marion Park Drive Kansas City, MO 64137-1405 (816) 966-7044
[email protected]
Figure 9 Not true Subscripting
7
or