Move =(+0,+5): Making SAS/GRAPH Work For You

Similar documents
It s Not All Relative: SAS/Graph Annotate Coordinate Systems

Chapter 13 Introduction to Graphics Using SAS/GRAPH (Self-Study)

INTRODUCTION TO THE SAS ANNOTATE FACILITY

The GSLIDE Procedure. Overview. About Text Slides CHAPTER 27

Tips for Producing Customized Graphs with SAS/GRAPH Software. Perry Watts, Fox Chase Cancer Center, Philadelphia, PA

... WHERE. AnnotaI8 Data.S... XSYS & YSYS. Harie Annotate: How Not to Lose Your Head When Enhancing BAS/GRAPH output

The GANNO Procedure. Overview CHAPTER 12

Usinq the VBAR and BBAR statements and the TEMPLATE Facility to Create side-by-side, Horizontal Bar Charts with Shared Vertical Axes Labels

Class #10 Wednesday, November 8, 2017

Coders' Corner. Paper ABSTRACT GLOBAL STATEMENTS INTRODUCTION

Effective Forecast Visualization With SAS/GRAPH Samuel T. Croker, Lexington, SC

Changing Titles on Graphs With Minimal Processing

Multiple Graphical and Tabular Reports on One Page, Multiple Ways to Do It Niraj J Pandya, CT, USA

Multiple Forest Plots and the SAS System

ODS LAYOUT is Like an Onion

The GTESTIT Procedure

Tips to Customize SAS/GRAPH... for Reluctant Beginners et al. Claudine Lougee, Dualenic, LLC, Glen Allen, VA

Copyright 2004, Mighty Computer Services

Slide 1 / 96. Linear Relations and Functions

The Plot Thickens from PLOT to GPLOT

HOUR 12. Adding a Chart

DOING MORE WITH WORD: MICROSOFT OFFICE 2013

Annotate Dictionary CHAPTER 11

DOING MORE WITH WORD: MICROSOFT OFFICE 2010

Using ANNOTATE MACROS as Shortcuts

Direct Variations DIRECT AND INVERSE VARIATIONS 19. Name

IMPROVING A GRAPH USING PROC GPLOT AND THE GOPTIONS STATEMENT

Tips and Tricks in Creating Graphs Using PROC GPLOT

Section Graphs and Lines

ANALISIS DE VITAMINAS

4. Write sets of directions for how to check for direct variation. How to check for direct variation by analyzing the graph :

Data Annotations in Clinical Trial Graphs Sudhir Singh, i3 Statprobe, Cary, NC

Pete Lund Looking Glass Analytics, Olympia, WA

Poster-making 101 for 1 PowerPoint slide

Creating Forest Plots Using SAS/GRAPH and the Annotate Facility

Input/Output Machines

Controlling Titles. Purpose: This chapter demonstrates how to control various characteristics of the titles in your graphs.

Select Cases. Select Cases GRAPHS. The Select Cases command excludes from further. selection criteria. Select Use filter variables

APPENDIX 4 Migrating from QMF to SAS/ ASSIST Software. Each of these steps can be executed independently.

DOING MORE WITH WORD: MICROSOFT OFFICE 2007

Data Driven Annotations: An Introduction to SAS/GRAPH s Annotate Facility

Mach4 CNC Controller Screen Editing Guide Version 1.0

New, standard features of DesignMerge Pro!

Unit 1, Lesson 1: Moving in the Plane

lundi 7 janvier 2002 Blender: tutorial: Building a Castle Page: 1

Top Award and First Place Best Presentation of Data Lan Tran-La. Scios Nova, Inc. BLOOD PRESSURE AND HEART RATE vs TIME

Lesson 1. Unit 2 Practice Problems. Problem 2. Problem 1. Solution 1, 4, 5. Solution. Problem 3

Want Quick Results? An Introduction to SAS/GRAPH Software. Arthur L. Carpenter California Occidental Consultants

Topic. Section 4.1 (3, 4)

* builds the RGB color string from the color. * reads the red, green; and blue values for. * constructs an ANNOTATE dataset by

Controlling the Control Palette

Working with Charts Stratum.Viewer 6

USING SAS PROC GREPLAY WITH ANNOTATE DATA SETS FOR EFFECTIVE MULTI-PANEL GRAPHICS Walter T. Morgan, R. J. Reynolds Tobacco Company ABSTRACT

SAS Visual Analytics 8.2: Working with Report Content

Custom Map Displays Created with SAS/GRAPH Procedures and the Annotate Facility Debra Miller, National Park Service, Denver, CO

USING GOPTION STATEMENTS FOR PC/SAS GRAPHIC DEVICES. Randy Van Beek South Dakota State University Computing Center

Linear Relations and. Functions. Scatter Plots. Slide 2 / 96. Slide 1 / 96. Slide 4 / 96. Slide 3 / 96. Slide 6 / 96. Slide 5 / 96.

Linear Relations and Functions

A Juxtaposition of Tables and Graphs Using SAS /GRAPH Procedures

Creating accessible forms

Posters. NESUG '96 Proceedings 530. John J. Cohen Advanced Data Concepts ABSTRACT DISCUSSION THE MANDELBROT SET? OUR FIRST TASK

SciGraphica. Tutorial Manual - Tutorials 1and 2 Version 0.8.0

Watch the video below to learn more about number formats in Excel. *Video removed from printing pages. Why use number formats?

SIMPLE TEXT LAYOUT FOR COREL DRAW. When you start Corel Draw, you will see the following welcome screen.

SolidWorks 2½D Parts

Coordinate System Techniques

Efofex Function Graphing

7/14/2009. Chapters Autocad Multi Line Text Tools. Multi Line Text Tool Ribbon. Multi Line Text Tool. July 14, 2009

The GIMPORT Procedure

Chapter 2: Descriptive Statistics (Part 1)

TSM Report Designer. Even Microsoft Excel s Data Import add-in can be used to extract TSM information into an Excel spread sheet for reporting.

A Plot & a Table per Page Times Hundreds in a Single PDF file

-Using Excel- *The columns are marked by letters, the rows by numbers. For example, A1 designates row A, column 1.

CHAPTER 1 COPYRIGHTED MATERIAL. Getting to Know AutoCAD. Opening a new drawing. Getting familiar with the AutoCAD and AutoCAD LT Graphics windows

SAS/GRAPH : Using the Annotate Facility

MANAGING SAS/GRAPH DISPLAYS WITH THE GREPLAY PROCEDURE. Perry Watts IMS Health

The first thing we ll need is some numbers. I m going to use the set of times and drug concentration levels in a patient s bloodstream given below.

POFT 2301 INTERMEDIATE KEYBOARDING LECTURE NOTES

Spreadsheet Warm Up for SSAC Geology of National Parks Modules, 2: Elementary Spreadsheet Manipulations and Graphing Tasks

7/21/2009. Chapters Learning Objectives. Fillet Tool

Graphical Cell Compiler

Picturing Statistics Diana Suhr, University of Northern Colorado

Adobe Illustrator. Quick Start Guide

Profiles - Objectives

Part II: Creating Visio Drawings

Something for Nothing! Converting Plots from SAS/GRAPH to ODS Graphics

A Step-by-step guide to creating a Professional PowerPoint Presentation

Class 3 Page 1. Using DW tools to learn CSS. Intro to Web Design using Dreamweaver (VBUS 010) Instructor: Robert Lee

AutoPagex Plug-in User s Manual

DOING MORE WITH POWERPOINT: MICROSOFT OFFICE 2013

Workbook Also called a spreadsheet, the Workbook is a unique file created by Excel. Title bar

IGCSE ICT Section 16 Presentation Authoring

Plotting Graphs. Error Bars

Chapter 10 Working with Graphs and Charts

ADOBE DREAMWEAVER CS4 BASICS

Microsoft Office OneNote 2007

Fiqure 1. Graphics 229. NESUG '93 Proceedings

SolidWorks Intro Part 1b

Learning to use the drawing tools

Save Forum Messages will be sent and Pages will be completed by pressing this Save button.

Transcription:

Move =(+0,+5): Making SAS/GRAPH Work For You Deb Cassidy, Computer Horizons Corporation, ndianapolis, N 've often been asked "Can SAS/GRAPH do...?" SAS/GRAPH can do almost anything - if you are willing to take the time. This paper shows you some of the options for enhancing your graph. The following code created a basic graph in BASESAS. PROC PLOT DATA=MWSUG; PLOT ATTEND*CONF_NO; TTLEl 'SAS USERS ATTENDNG MWSUG'; FOOTNOTE 'NOT ACTUAL DATA ' 'MWSUG SEPT93'; This graph probably would not convince your boss to send you to the MidWest conference. GOPTONS SAS/GRAPH lets you change many options. Before you begin a graph, make sure you know how options are set for your device. You will need to be concerned with both the viewing device and printing device. Options are specified with a GOPTONS statement. The one option everyone must specify is DEVCE=. SAS prompts you if you don't tell it the device. You may not need any other options or you may need several Some sites have created macros to supply all the options for a device so individuals do not need to enter them. You can override options with another GOPTONS statement. You can also override some within the statements for your graph. To know what options you device has as defaults, run GOPTONS DEVCE= your device; PROC GOPTONS; f you want to know what statements are in effect at a specific point in your program, you should specify the statement(s) you want to see. For example: PROC GOPTONS SYMBOL AXS NOLST; will give you the SYMBOL and AXS statements while suppressing the list of graphics options. Options stay in effect until you reset them or end your SAS session (for batch and noninteractive, each job would be a session). Any options listed before a RUN or a PROC will affect the graph. RUN or PROC tells SAS to go ahead and created the graph. Many times you won't get what you expected because of an earlier option that is still in effect or because you didn't set an option that you had in a previous session. suggest always putting options before a graph and using RUN after each graph. However, too many RUN statements can cause problems. f you get multiple copies of a graph, look for duplicate RUN statements. This is most likely to happen if you have a RUN within a macro. f you rely on PROC statements to signal the end of a graph, you may need a RUN statement after the last graph. ENHANCED GRAPH The following code creates the enhanced graph shown. The first step should be to run the graph without any enhancements to make sure you have the basic graph correct. Then you should work through each enhancement to verify how it changes the graph. As you become more familiar with the options, you can put more in each run. However, 803

sometimes you will not be able to use some options with others. For example, if your titles and footnotes are too tall, you will not get your graph. You may need to change all the heights and widths 've shown if you have a different HPOS and VPOS for your device. GOPTONS DEVCE=your device HPOS=80 VPOS=32 COLORS=(BLACK) FTEXT=SWSS; PROC GPLOT DATA=MWSUG; PLOT ATTEND*CONF_NO / VAXS=AXS HAXS=AXS2 VMNOR=l HMNOR=O; AXS ORDER=(200 TO 550 BY 50) LABEL (A=90 'ATTENDANCE') WDTH=2 OFFSET=(2 PCT, 2.2 PCT); AXS2 VALUE= (TCK=l J=C 'MNNEAPOLS' J=C '1990' TCK=2 J=C 'CHCAGO' J=C '1991' TCK=3 J=C 'KANSAS CTY' J=C '1992' TCK=4 H=1.5 J=C 'NDANAPOLS' J=C'1993'); LABEL=(H=1.5 'CONFERENCE') WDTH=2 OFFSET=(3 PCT); SYMBOL1 H=3 FONT=, VALUE=DAMOND =JON WDTH=2; TTLE1 'SAS' MOVE=(+O, +1 PCT) F=SPECAL 'R' MOVE=(+O, -1 PCT) F=SWSS ' USERS ATTENDNG F=CENTB 'MWSUG'i TTLE2 H=3. 3 A=-90 ' NOTE MOVE=(71 PCT, 50 PCT) 'FUTURE CONFERENCES' DRAW=(+O PCT, -1 PCT, 71 PCT, +0 PCT) MOVE=(71 PCT, 46 PCT) '1994 - OMAHA' MOVE={71 PCT, 43 PCT) '1995 - 'SOME CTY'); NOTE MOVE=(84, 78.5 PCT) BOX=2 H=.5 F=DUPLEX 'EXPECTED'; FOOTNOTE H=.5 J=L 'FCTTOUS DATA' J=R 'MWSUG - - SEPT 93'; RUN; '; The plot shows the attendance on the Y-axis (vertical) and the conference number on the X-axis (horizontal). V AXS 1 =AXS 1 says to create the vertical axis using the instructions in the AXS 1 statement HAXS=AXS2 says to create the horizontal axis using the instructions in the AXS2 statement. You do not have to use a specific axis number for vertical or. horizontal. Some graphs have 2 horizontal or vertical axes. AXS numbers can be 1 to 99 although most people start with 1. AXS says to start at 200 and go to 550 by 50 unit increments. n the example, one value if at 505. f you try to use ORDER=(200 TO 500 BY 50), you will lose that point You could also use ORDER=(200 TO 500 BY 50, 505) which says to put a tick mark at 505 also, However, the distance between 500 and 505 will be the same as between 450 and 500. LABEL=(A=90 'ATTENDANCE,) says to use ATTENDANCE instead of the variable name. A=90 angles the entire label from the horizontal line. You may need to use A=90 and R=O together. R= says to ROTATE each letter. n this case, you are over-riding any default rotation. 've usually had this problem if there is already a label for the variable in my data set WD1H=2 makes the axis itself wider. f you have a data point in the corner of the graph, you may want to use OFFSET= to give it more room. The first value moves the first major tick mark away from the intersection of the axes. The second value moves the last major tick mark away from the end of the axis. You can use one without the other. OFFSET only affects the axis specified. 804

The AXS2 statement uses some of the same options as AXS 1. 've used the default order although could have specified ( TO 4) or ( T04 BY ). 've also labeled the major tick marks. You can use a format to label the tick marks but you have fewer options. wanted to create a 2-line label. also wanted to increase the height for the current site. This method lets me customize each tick mark. To create multiple lines, you must center each section of, the label. This also works for X-axis labels. SAS nstitute is aware that it doesn't always work for Y axis labels. The plot statement has two other options - VMNOR= and HMNOR=O. These statements indicate how many minor tick marks to include. On the vertical axis want one smaller tick mark between each major one. n this example, that provides marks every 25 units. Since my conference numbers are discrete, want to suppress minor tick marks on the horizontal axis. You could also have used MNOR=NONE in the AXS2 statement to delete them. You also have the options of customizing minor tick marks. SYMBOL! describes how to put symbols on the points. By default, you get a symbol on each point and the points are not joined. want the symbols to have HEGHT=3. want to NTERPOLATE the points between the actual points by simply JONing the points. There are many other options for NTERPOLATE. The line joining the points will have a WDTH of 2. also want to specify the symbol. There are special symbols that are only used in a symbol statement. You can also use any character by specifying a font and placing the letter in quotes. For example: FONT=SPECAL VALUE='R' would give the registered trademark symbol on the graph. f you don't specify the font, SAS looks for the specified value as one of the special symbols. f it isn't used as a special symbol, you get the actual value specified. By using V ALUE=DAMOND, get a diamond as the symbol. f there is a font specified and use V ALUE=DAMOND, actually get the word DAMOND. Symbols and patterns will keep any option you used in an earlier statement with the same number. f had an earlier SYMBOL! FONT=DUPLEX statement, would get the word DAMOND in duplex. The FONT=, included in this symbol statement makes sure get the special symbol. f, this sounds confusing, use PROC GOPTONS SYMBOL NOLST; to see what SAS "sees". The first title statement shows how named this presentation. wanted the registered trademark symbol to be superscript. MOVE= tells SAS to go to a different point before writing the next section of text. A + or - indicates this point is relative to where the last text was written. No sign indicates to go to that point regardless of the location of, the current text. The first value indicates the horizontal direction and the second value the vertical direction. wanted to slide the character up but keep it in the default horizontal direction. The +0 indicates to keep the default. wanted to move the text up 1 percent. After finish with the character, wanted to move the next text back to the original line so use -1 percent. Don't forget to include the blank spaces in one of the strings. also used different fonts. f, you want to move the first string and use a relative position, you must use TTLE', MOVE=... ; to get a starting point. 805

TTLE2 is a blank title so why did include it? By using A=-90, moved the title to the right-hand side of the graph. This makes the graph smaller and gives me a larger right margin. The NOTE statement will then appear in that margin without overwriting any of the graph. The HEGHT= determines how much additional space have. could have used OFFSET the move the plot itself over but the axis would still be there. NOTE statements may be one of the most useful and least used statements in SAS/GRAPH. n some cases, NOTEs can let you avoid creating an ANNOTATE data set. By default, NOTEs are written in the procedure output area. They are leftjustified and placed at the top of the area. They will overwrite your graph instead of reducing the size of the graph like TTLE and FOOTNOTE do. You can have any number of NOTEs and they do not have a number. rarely use NOTE without a MOVE= to position it exactly where want. have only note statement but it prints 3 lines of text and draws a line. The MOVE= works like it did in the TTLE statement but it uses absolute values. The tricky part is drawing the line. The line is actually drawn from right to left. To draw a line, you need to specify the ending point. You know the left-hand point is just below the starting point of your text - a point you specified. However, you don't know the ending point of your text. By starting relative to the end of the text, you only need to specify the X value for the left end of the line. f you want to box the entire note, you can only use relative points in your MOVE. Finding the correct coordinates can be frustrating if you have more than a couple lines. recommend using an ANNOTATE data set for that case. The second note does use a BOX= option. The value specifies the width of the lines for the box. This note actually appears in the graph area. 've also reduced the HEGHT of the text and changed the font. The footnote statement left justifies part of the text and right justifies the rest. The default is centered text. A HELPFUL GRD You think MOVE= will be helpful but how do you know what values to use without a lot of guesswork? The following code will generate a grid which can be placed over your graph to help determine coordinates. The grid is based on percentage of the graphics output area. You might also want a grid which shows your cells based on HPOS and VPOS. You will need to change the DO loop accordingly. For each line you want to draw, your annotate data set needs one observation that moves to one end of the line. A second observation is needed that will draw to the other end of the line. The grid is displayed using PROC GANNO. DATA ANNO; f * X AND Y VALUES BASED ON PERCENTAGE OF THE GRAPHCS OUTPUT AREA *j RETAN XSYS '3' YSYS '3'; DO 1=0 TO 100 BY 10; j * DRAW VERTCAL LNES * f x= ; Y =0; FUNCTON= 'MOVE'; OUTPUT; Y=100; FUNCTON='DRAW'; OUTPUT; f* DRAW HORZONTAL LNES *f Y=; X=O; FUNCTON='MOVE'; OUTPUT; X=100; FUNCTON='DRAW'; OUTPUT; PROC GANNO ANNO=ANNO GOUT=MWSUG.PLOTS NAME=GRDl; RUN; 806

OTHER COMMENTS The values needed for height and width will vary based on HPOS and VPOS. PERCENT is the only value that is consistent across devices and options because it is proportional. Even inches and centimeters may not work if you go to a smaller device or changes options. Since it is impossible to cover all options, you should use the manuals for additional details. The programs for examples in the manual are included in a library provided with the system. Contact your site representative for details on how to access this library. The manual indicates a program name. These programs can help you learn how your device(s) work (and differ) as well as how to write the program. This paper is part of a presentation given at the 1993 MidWest SAS Users Group conference. The proceedings contain additional examples of enhancing graphs. DATA FOR THE GRAPH DATA MWSUG; NPUT CONF_NO ATTEND; CARDS; 1 200 2 500 3 450 4 505 At times, using SAS/GRAPH is oial and error. But remember, what didn't work this time may be the solution to your next graph. You may want to keep a notebook for both your successes and failures. nclude the code, log and the graph. SAS and SAS/GRAPH are registered trademarks of SAS nstitute nc. in the USA and other counoies. Contact: Deb Cassidy 3809 Secretariat Court Columbus, OH 43221 (614) 771-7861 (leave message on answering machine) or Computer Horizons Corporation 1980 E. 116th Street, Suite 325 Carmel, N 46032 (317) 574-5600 807

ATTEU S50 + ~O+ 'lot or ATTtlCO-COMfJlO. $AS ustrs ATTECDMG tosug A Lagend. 11." 1 obi. 8 =' 2 obi. atc. _50 + A 000 + 150 + 100 + 250 + 200 +. ~-.+--.----------------------------+-------------------------------+-------------------------------+-- 1 2 1 " COMf.140 fcttous OATil. MWSUG -- SE'T 91 SAS USERS ATTENDNG MWSUG 550 w 0 z ~ z w ~ 500 450 400 350 300 250 200 FUTURE CONFERENCES 1994 - OMAHA 1995 - SOME CTY MNNEAPOUS 1990 CHCAGO 1991 KANSAS CTY 1992 CONFERENCE NDANAPOUS 1993 FCTmOUS DATA MWSUG - - SEPT t3 808