24
SAS/GRAPH Annotate HOW TO CREATE CUSTOMIZED GRAPHS

SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

SAS/GRAPH AnnotateHOW TO CREATE CUSTOMIZED GRAPHS

Page 2: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

TopicsWhat is SAS Annotate?

How SAS Annotate is used?

Key functions

How an annotate dataset looks

Page 3: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

What is SAS Annotate Facility?The Annotate facility enables us to generate a special data set of graphics commands from which we can produce graphics output. We can use it to generate custom graphics or to enhance graphics output:

Labelling points on a plot

Outlier

Page 4: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

What is SAS Annotate Facility?The Annotate facility enables us to customise SAS-generated graphs to better suit our needs:

Labelling points on a plot

Customising and adding labels to the bar in a bar chart

[105] [110] [95]90% 100% 80%

AAA BBB CCC

Page 5: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

What is SAS Annotate Facility?

All information in the succeeding slides are taken from http://support.sas.com/

No. of employees

% full-time

The Annotate facility enables us to customise SAS-generated graphs to better suit our needs:

Labelling points on a plot

Customising and adding labels to the bar in a bar chart

Customising legends

Page 6: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

The Annotate facility enables us to customise SAS-generated graphs to better suit our needs:

Labelling points on a plot

Customising and adding labels to the bar in a bar chart

Customising legends Creating a custom graph

[105] AAA

BBB

AAA

CCC

BBB

[97]

[111]

[85]

[90]

Cat 1

Cat 2

Cat 3

Cat 4

Cat 5

What is SAS Annotate Facility?

All information in the succeeding slides are taken from http://support.sas.com/

Page 7: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

TopicsWhat is SAS Annotate?

How SAS Annotate is used?

Key functions

How an annotate dataset looks

Page 8: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

How SAS Annotate is Used

► PROC GCHART

► PROC GMAP

► PROC GPLOT

► PROC GSLIDE

SAS Annotate is used by creating a special data set that contains graphic commands to produce the desired graphics output

It can be used either to create a custom graph

Or attach to the following procedures to enhance the output

► PROC GCONTOUR

► PROC G3D

Page 9: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

Sample annotate dataset

Page 10: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

TopicsWhat is SAS Annotate?

How SAS Annotate is used?

Key functions

How an annotate dataset looks

Page 11: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

Most commonly used functions

Key Annotate Functions

Function Use

BARDraws a rectangle; often used in generating bar graphs

Annotate variables commonly used with*

SIZE, STYLE, LINE, COLOR

DRAWDraws a line; usually needs the function MOVE to work more accurately

SIZE, LINE, COLOR

MOVEDoes not draw nor write but is essential in moving the pointer for functions BAR and DRAW to work well and more accurately as desired

LABEL Writes a text or symbolSIZE, LINE, STYLE, COLOR

* All functions require xsys, ysys, x and y variables to work well

Page 12: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

Other useful functions

Other Annotate Functions

Function Use

POLYSimilar to MOVE, this is the start point when drawing a polygon

Annotate variables commonly used with*

SIZE, STYLE, LINE, COLOR

POLYCONT Draws a line from the POLY or prior POLYCONTSIZE, LINE, STYLE, COLOR

PIE Draws a pie slice, arc or a full circle ANGLE, COLOR, LINE

* All functions require xsys, ysys, x and y variables to work well

Page 13: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

TopicsWhat is SAS Annotate?

How SAS Annotate is used?

Key functions

How an annotate dataset looks

Page 14: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

Sample 1: datasetDrawing a horizontal line

move is used to move the cursor in your x-y plane

In this case, we move the cursor to point (25,50)

Page 15: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

draw is used to draw a line from the last position your cursor is located to the specified (x,y) point

In this case, we draw a line from point (25,50) to (75,50)

Sample 1: datasetDrawing a horizontal line

Page 16: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

Sample 1: output

Page 17: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

Sample 2: datasetCreating a scatter plot

label is used to write a text in the defined (x,y) point

Page 18: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

size – font sizecolor – font colorstyle – font styleposition – horizontal and vertical alignment

Sample 2: datasetCreating a scatter plot

Page 19: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

Sample 2: output

Page 20: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

Sample 2: output

Page 21: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

Sample 3: output

Page 22: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

Sample 3: dataset

Page 23: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

How to determine graphs areahttps://support.sas.com/documentation/cdl/en/graphref/63022/HTML/default/viewer.htm#annotate_xsys.htm

Page 24: SAS/GRAPH Annotate Group Presentati… · SIZE, STYLE, LINE, COLOR DRAW Draws a line; usually needs the function MOVE to work more accurately SIZE, LINE, COLOR MOVE Does not draw

Position of labelshttps://support.sas.com/documentation/cdl/en/graphref/63022/HTML/default/viewer.htm#annotate_position.htm