Presentation is loading. Please wait.

Presentation is loading. Please wait.

SAS/GRAPH The Basics. Today’s Topics GOPTIONS GPLOT GCHART GCONTOUR G3D.

Similar presentations


Presentation on theme: "SAS/GRAPH The Basics. Today’s Topics GOPTIONS GPLOT GCHART GCONTOUR G3D."— Presentation transcript:

1 SAS/GRAPH The Basics

2 Today’s Topics GOPTIONS GPLOT GCHART GCONTOUR G3D

3 Example 5.1.1 Getting Started in SAS/GRAPH GOPTIONS: – Similar to OPTION, but specific to SAS/GRAPH – Gives instructions about appearance of graphs – Applies for entire SAS session or until reset within a session – Can appear anywhere in program, but preferably within SAS/GRAPH procedure

4 Examples 5.2.1, 5.2.2 GPLOT:Creating a Scatter Plot Procedure GPLOT PROC GPLOT DATA=dataset; PLOT y*x(=z)/options; RUN; QUIT;

5 Example 5.3.1 SYMBOL Statement Controls appearance of symbols in graph Options include: – VALUE= (V=) – INTERPOL= (I=) – COLOR= (C=) – LINE= (L=)

6 The OVERLAY and LEGEND options Appear after slash (/) in PLOT statement OVERLAY used when PLOT has more than one X or Y OVERLAY cannot be used with form y*x=z LEGEND option causes legend to print Legend prints automatically with y*x=z form, but not with OVERLAY option

7 Example 5.3.2 AXIS Statement Controls appearance of axes Define which axis with VAXIS= and HAXIS= options in PLOT statement Some options available include: – LABEL= – ORDER= – VALUE= – MINOR= – MAJOR=

8 GCHART Horizontal Bar Charts (2D and 3D) Vertical Bar Charts (2D and 3D) Pie Charts (2D and 3D) Block Charts Star Charts

9 Examples 5.4.1, 5.4.2 Creating a Histogram Use the VBAR statement Options include: – Specifying midpoints – Changing patterns in bars

10 Example 5.4.3 Creating Horizontal and Vertical Bar Frequency Charts Statements are VBAR and HBAR When data are counts, use FREQ= option

11 Example 5.4.5 Cross-Classification in Charts Classify bars by 2 variables instead of just one List one variable in HBAR or VBAR statement List second variable in GROUP= option

12 Examples 5.6.1, 5.6.2 Plots of 3D Data Contour plot (Y*X=Z format) – Y-variable defines y-axis – X-variable defines x-axis – Z-variable defines levels of contours 3-D Plot (Y*X=Z format) – Y-variable defines y-axis – X-variable defines x-axis – Z-variable defines z-axis – Scatter plot or Surface plot

13 Contour Plots PROC GCONTOUR Options available include: – LEVELS: levels of contours – LLEVELS: line types of contours – HAXIS, VAXIS: same as GPLOT – HREF, VREF: draws reference lines – LEGEND: same as before

14 3-D Plots PROC G3D – Surface plot: PLOT statement – Scatter plot: SCATTER statement Options available with only the PLOT statement: – CTOP, CBOTTOM: color of top and bottom of surface Options available with only the SCATTER statement: – SHAPE: defines shapes of symbols – COLOR: defines color of symbols

15 Examples 5.6.3, 5.6.4, 5.6.5 Options with PLOT or SCATTER in G3D ROTATE: rotates graph specified # of degrees TILT: tilts graph specified # of degrees (must be between 0 and 90) XTICKNUM, YTICKNUM: defines # of tick marks CAXIS: color of axes ZMAX, ZMIN: defines min and max values for z- axis GRID: draws grid “walls”


Download ppt "SAS/GRAPH The Basics. Today’s Topics GOPTIONS GPLOT GCHART GCONTOUR G3D."

Similar presentations


Ads by Google