/*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR02N01 | | TITLE: REFERENCE GUIDE CHAPTER 02 OUTPUT 01 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS AXIS SYMBOL GPLOT | | PROCS: GPLOT | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htext=3; /* create data set SAMPLE */ data sample; input x y; cards; 1 4 2 5 3 2 4 3 ; run; /* define symbol and axis characteristics */ symbol height=5; axis1 length=6.1 in; axis2 length=2.3 in; /* define footnote */ footnote justify=right 'GR02N01 '; /* plot Y*X */ proc gplot data=sample; plot y*x / haxis=axis1 vaxis=axis2 des='GR02N01-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR02N02 | | TITLE: REFERENCE GUIDE CHAPTER 02 OUTPUT 02 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS AXIS SYMBOL GPLOT | | PROCS: GPLOT | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 07NOV89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=4 htext=3; /* create data set SAMPLE */ data sample; input x y; cards; 1 4 2 5 3 2 4 3 ; run; /* define the footnote and titles */ footnote justify=right color=blue 'GR02N02 '; title1 color=blue 'Comparison of Units Sold'; title2 height=4 color=blue '1984 - 1987'; /* define axis and symbol characteristics */ axis1 value=(color=red height=3 tick=1 '1984' tick=2 '1985' tick=3 '1986' tick=4 '1987') major=(height=.5 width=3) label=(color=red height=3 'Year Sold') width=3 length=55 origin=(23, 26); axis2 order=(1 to 5) value=(color=red height=3) major=(height=.5 width=3) label=(color=red height=3 'Units Sold' justify=right 'in Thousands') width=3; symbol height=5 value='M' width=3 font=special color=green interpol=join; /* plot Y*X */ proc gplot data=sample; plot y*x / frame haxis=axis1 vaxis=axis2 des='GR02N02-1'; run; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR09N01 | | TITLE: REFERENCE GUIDE CHAPTER 09 OUTPUT 01 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS PATTERN GCHART | | PROCS: GCHART | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create data set SALES */ data sales; length state $ 8; format sales dollar8.; input state sales; cards; CA 13636 OR 18988 WA 14523 IL 18038 IN 13611 OH 11084 MI 19660 FL 14541 GA 19022 ; run; /* define title and footnote */ title 'US Sales Goal: $15,000'; footnote j=r 'GR09N01 '; /* define pattern characteristics */ pattern value=solid color=blue; /* generate vertical bar chart */ proc gchart data=sales; vbar state / midpoints='CA' 'OR' 'WA' 'IL' 'IN' 'OH' 'MI' 'FL' 'GA' sumvar=sales width=5.5 ref=15000 des='GR09N01-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR09N02 | | TITLE: REFERENCE GUIDE CHAPTER 09 OUTPUT 02 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS AXIS PATTERN GCHART | | PROCS: GCHART | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create data set SALES */ data sales; length state $ 8; format sales dollar8.; input state sales; cards; CA 13636 OR 18988 WA 14523 IL 18038 IN 13611 OH 11084 MI 19660 FL 14541 GA 19022 ; run; /* define title and footnote */ title 'US Sales Goal: $15,000'; footnote j=r 'GR09N02 '; /* define pattern characteristics */ pattern value=solid color=blue; /* define axis characteristics */ axis1 order=('CA' 'OR' 'WA' 'IL' 'IN' 'OH' 'MI' 'FL' 'GA') color=red label=none value=(angle=50 font=swissl height=2.5 tick=1 color=blue 'California' tick=2 'Oregon' tick=3 color=blue 'Washington' tick=4 'Illinois' tick=5 color=blue 'Indiana' tick=6 color=blue 'Ohio' tick=7 'Michigan' tick=8 color=blue 'Florida' tick=9 'Georgia') width=5; axis2 order=(0 to 20000 by 5000) label=none value=(tick=1 '' tick=4 color=red) style=0 major=none minor=none; /* generate vertical bar chart */ /* and assign AXIS definitions */ proc gchart data=sales; vbar state / sumvar=sales width=6 ref=15000 maxis=axis1 raxis=axis2 des='GR09N02-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR09N03 | | TITLE: REFERENCE GUIDE CHAPTER 09 OUTPUT 03 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS AXIS SYMBOL GPLOT | | PROCS: GPLOT | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create the data set STATS */ data stats; input height weight; cards; 69.0 112.5 56.5 84.0 65.3 98.0 62.8 102.5 63.5 102.5 57.3 83.0 59.8 84.5 62.5 112.5 62.5 84.0 59.0 99.5 51.3 50.5 64.3 90.0 56.3 77.0 66.5 112.0 72.0 150.0 64.8 128.0 67.0 133.0 57.5 85.0 ; run; /* define title and footnotes */ title 'Study of Height vs Weight'; footnote1 j=l ' Source: T. Lewis & L. R. Taylor'; footnote2 j=l ' Introduction to Experimental Ecology' j=r 'GR09N03 '; /* define symbol characteristics */ symbol interpol=rc color=blue value=star height=3; /* define axis characteristics */ axis1 order=(45 to 155 by 10) color=red label=('Weight in Pounds') major=(height=.75cm width=2) minor=(number=1 height=.5cm width=1) offset=(0,0) width=3; axis2 order=(48 to 78 by 6) color=red label=('Height' justify=right 'in Inches') major=(height=.75cm width=2) minor=(height=.5cm width=1) offset=(0,0) width=3; /* generate scatter plot */ /* and assign AXIS definitions */ proc gplot data=stats; plot height*weight / haxis=axis1 vaxis=axis2 frame des='GR09N03-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR09N04 | | TITLE: REFERENCE GUIDE CHAPTER 09 OUTPUT 04 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS AXIS SYMBOL GPLOT | | PROCS: GPLOT | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create the data set HILO */ /* structure the data set so that each value */ /* of DOW is in a separate observation */ data hilo; input date date7. @18 high low close; format date date7.; drop high low close; dow=high; output; dow=low; output; dow=close; output; cards; 03AUG81 3219.3 955.48 940.45 946.25 04AUG81 2938.5 951.39 937.40 945.97 05AUG81 4177.8 958.81 942.16 953.58 06AUG81 3975.7 961.47 947.30 952.91 07AUG81 3884.3 954.15 938.45 942.54 10AUG81 2937.7 948.82 935.88 943.68 11AUG81 5262.9 955.48 939.50 949.30 12AUG81 4005.2 955.86 942.26 945.21 13AUG81 3680.8 952.91 938.55 944.35 14AUG81 3714.1 947.77 933.79 936.93 17AUG81 3432.7 939.40 924.37 926.75 18AUG81 4396.7 932.74 916.38 924.37 19AUG81 3517.3 932.08 918.38 926.46 20AUG81 3811.9 935.31 923.52 928.37 21AUG81 2625.9 930.65 917.14 920.57 24AUG81 4736.1 917.43 896.97 900.11 25AUG81 4714.4 904.30 887.46 901.83 26AUG81 3279.6 908.39 893.65 899.26 27AUG81 3676.1 900.49 883.66 889.08 28AUG81 3024.2 898.78 884.80 892.22 ; run; /* define titles and footnote */ title1 'Dow Jones High-Low-Close'; title2 h=4 'August, 1981'; footnote j=r 'GR09N04 ' ; /* define symbol characteristics */ symbol interpol=hiloct cv=blue width=3; /* define axis characteristics */ axis1 order=('02AUG81'd to '30AUG81'd by week) color=red label=none major=(height=3 width=2) minor=(number=6 color=blue height=3 width=1) offset=(3,3) width=3 origin=(,21.4); axis2 order=(880 to 970 by 10) color=red label=none major=(height=3) minor=(number=4 color=blue height=1) offset=(2,2) origin=(15,20) width=3; /* generate plot and assign AXIS definitions */ proc gplot data=hilo; plot dow*date / frame haxis=axis1 vaxis=axis2 des='GR09N04-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR09N05 | | TITLE: REFERENCE GUIDE CHAPTER 09 OUTPUT 05 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS AXIS PATTERN GCHART | | PROCS: GCHART | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create the data set STOCKS */ data stocks; input @7 hdate date7. high @24 ldate date7. low; format hdate ldate date7.; cards; 1954 31DEC54 404.39 11JAN54 279.87 1955 30DEC55 488.40 17JAN55 388.20 1956 06APR56 521.05 23JAN56 462.35 1957 12JUL57 520.77 22OCT57 419.79 1958 31DEC58 583.65 25FEB58 436.89 1959 31DEC59 679.36 09FEB59 574.46 1960 05JAN60 685.47 25OCT60 568.05 1961 13DEC61 734.91 03JAN61 610.25 1962 03JAN62 726.01 26JUN62 535.76 1963 18DEC63 767.21 02JAN63 646.79 1964 18NOV64 891.71 02JAN64 768.08 1965 31DEC65 969.26 28JUN65 840.59 1966 09FEB66 995.15 07OCT66 744.32 1967 25SEP67 943.08 03JAN67 786.41 1968 03DEC68 985.21 21MAR68 825.13 1969 14MAY69 968.85 17DEC69 769.93 1970 29DEC70 842.00 06MAY70 631.16 1971 28APR71 950.82 23NOV71 797.97 1972 11DEC72 1036.27 26JAN72 889.15 1973 11JAN73 1051.70 05DEC73 788.31 1974 13MAR74 891.66 06DEC74 577.60 1975 15JUL75 881.81 02JAN75 632.04 1976 21SEP76 1014.79 02JAN76 858.71 1977 03JAN77 999.75 02NOV77 800.85 1978 08SEP78 907.74 28FEB78 742.12 1979 05OCT79 897.61 07NOV79 796.67 1980 20NOV80 1000.17 21APR80 759.13 1981 27APR81 1024.05 25SEP81 824.01 1982 27DEC82 1070.55 12AUG82 776.92 1983 29NOV83 1287.20 03JAN83 1027.04 1984 06JAN84 1286.64 24JUL84 1086.57 1985 16DEC85 1553.10 04JAN85 1184.96 1986 02DEC86 1955.57 22JAN86 1502.29 1987 25AUG87 2722.42 19OCT87 1738.74 ; run; /* restructure the data so that there is one observation */ /* for each time a HIGH or LOW occurs in a given month */ data new; set stocks; drop high low; month=month(hdate); value='high'; output; month=month(ldate); value='low'; output; run; /* define titles and footnote */ title1 'Dow Jones Yearly Highs and Lows'; title2 h=4 ' Frequency by Month'; title3 '1954 to 1988'; footnote j=l ' Source: 1987 World Almanac' j=r 'GR09N05 '; /* define pattern characteristics */ pattern1 value=solid color=red; pattern2 value=solid color=blue; /* define axis characteristics */ axis1 label=none value=(height=2.5 'Hi' 'Lo'); axis2 label=none minor=none; axis3 label=none value=(color=green 'JAN' 'FEB' 'MAR' 'APR' 'MAY' 'JUN' 'JUL' 'AUG' 'SEP' 'OCT' 'NOV' 'DEC'); /* generate bar chart */ /* and assign AXIS definitions */ proc gchart data=new; vbar value / patternid=midpoint group=month missing width=4 space=0 maxis=axis1 raxis=axis2 gaxis=axis3 des='GR09N05-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR09N06 | | TITLE: REFERENCE GUIDE CHAPTER 09 OUTPUT 06 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS AXIS SYMBOL GPLOT | | PROCS: GPLOT | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create the data set CONCENTR */ data concentr; input ph conc; cards; 1 1E-1 2 1E-2 3 1E-3 4 1E-4 5 1E-5 6 1E-6 7 1E-7 8 1E-8 9 1E-9 10 1E-10 11 1E-11 12 1E-12 13 1E-13 14 1E-14 ; run; /* define title and footnotes */ title 'Relationship of pH to H' move=(-0,-3) h=4 '3' move=(+0,+3) h=6 'O' move=(+0,+3) h=4 '+' move=(-0,-3) h=6 ' Concentration'; footnote j=r 'GR09N06 '; /* define symbol characteristics */ symbol interpol=join color=blue; /* define axis characteristics */ axis1 label=('pH') minor=none width=3; axis2 logbase=10 logstyle=expand label=(justify=left 'Concentration' justify=left '(Moles/Liter)' ) value=(color=red tick=1 '10' height=1.5 '-14' tick=2 '10' height=1.5 '-13' tick=3 '10' height=1.5 '-12' tick=4 '10' height=1.5 '-11' tick=5 '10' height=1.5 '-10' tick=6 '10' height=1.5 '-9' tick=7 '10' height=1.5 '-8' tick=8 '10' height=1.5 '-7' tick=9 '10' height=1.5 '-6' tick=10 '10' height=1.5 '-5' tick=11 '10' height=1.5 '-4' tick=12 '10' height=1.5 '-3' tick=13 '10' height=1.5 '-2' tick=14 '10' height=1.5 '-1') major=(color=red height=.75 cm) minor=(number=8 color=blue height=.5 cm) width=3 ; /* generate plot and assign AXIS definitions */ proc gplot data=concentr; plot conc*ph / haxis=axis1 vaxis=axis2 frame des='GR09N06-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR10N01 | | TITLE: REFERENCE GUIDE CHAPTER 10 OUTPUT 01 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS AXIS PATTERN GCHART | | PROCS: SORT GCHART | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create data set TOTALS */ data totals; length dept $ 7 site $ 8; format quarter roman.; format sales dollar8.; input dept site quarter sales; cards; Parts Sydney 1 7843.97 Parts Atlanta 1 9225.26 Repairs Sydney 1 6092.82 Repairs Atlanta 1 10210.21 Tools Sydney 1 5017.36 Tools Atlanta 1 6254.18 Parts Sydney 2 5023.44 Parts Atlanta 2 11595.07 Repairs Sydney 2 6005.31 Repairs Atlanta 2 7789.59 Tools Sydney 2 8245.17 Tools Atlanta 2 3003.99 Parts Sydney 3 10537.96 Parts Atlanta 3 7047.91 Repairs Sydney 3 4726.46 Repairs Atlanta 3 5411.66 Tools Sydney 3 4067.10 Tools Atlanta 3 6248.52 Parts Sydney 4 10565.57 Parts Atlanta 4 9588.51 Repairs Sydney 4 10312.99 Repairs Atlanta 4 7488.30 Tools Sydney 4 2075.74 Tools Atlanta 4 3624.19 ; run; /* define title and footnote for chart */ title 'Quarterly Sales'; footnote j=r 'GR10N01(a) '; /* define pattern and axis characteristics */ pattern value=solid color=green; axis width=3; /* generate vertical bar chart */ /* using GROUP=SITE */ proc gchart data=totals; vbar quarter / frame discrete sumvar=sales group=site gaxis=axis raxis=axis des='GR10N01-1'; run; /* sort data set TOTALS in order by site */ proc sort data=totals; by site; run; /* define new footnote for chart */ footnote j=r 'GR10N01(b) '; /* generate vertical bar chart using BY-group */ /* processing to produce a different chart */ /* for each site */ proc gchart data=totals; by site; vbar quarter / frame discrete sumvar=sales gaxis=axis raxis=axis des='GR10N01-2'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR11N01 | | TITLE: REFERENCE GUIDE CHAPTER 11 OUTPUT 01 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS GSLIDE | | PROCS: GSLIDE | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* define TITLE statements */ title1 height=3 justify=left ' Title Area'; title2 height=6 justify=center 'Footnote Size & Positions'; /* define footnotes */ footnote1 'FOOTNOTE1' justify=left ' Footnote Area'; footnote2 'FOOTNOTE2'; footnote3 'FOOTNOTE3'; footnote4 'FOOTNOTE4'; footnote5 'FOOTNOTE5'; footnote6 'FOOTNOTE6'; footnote7 'FOOTNOTE7'; footnote8 'FOOTNOTE8'; footnote9 'FOOTNOTE9'; footnote10 'FOOTNOTE10' justify=right 'GR11N01 '; /* display titles and footnotes */ proc gslide frame des='GR11N01.sas'; note ' Procedure Output Area'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR11N02 | | TITLE: REFERENCE GUIDE CHAPTER 11 OUTPUT 02 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS GSLIDE | | PROCS: GSLIDE | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htext=3; /* define footnotes */ footnote1 justify=left ' FY 1989' justify=center height=5 'Annual Summary' justify=right height=3 'QWERTY Inc. '; footnote2 justify=left ' Source: SEC Files'; footnote3 justify=right 'GR11N02 '; /* display the footnotes */ proc gslide des='GR11N02-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR11N03 | | TITLE: REFERENCE GUIDE CHAPTER 11 OUTPUT 03 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS GSLIDE | | PROCS: GSLIDE | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htext=3; /* define footnotes */ footnote1 height=5 'This is FOOTNOTE1'; footnote2 height=5 underlin=1 'FOOTNOTE2 Is' color=red ' Underlined'; footnote5 height=4 color=red angle=-90 'FOOTNOTE5 is Angled -90'; footnote6 height=5 color=blue rotate=25 'FOOTNOTE6 is Rotated'; footnote7 height=5 color=green box=1 'FOOTNOTE7 is Boxed'; footnote8 height=5 move=(12,25) bcolor=green color=red box=3 color=white 'FOOTNOTE8 is Overlaid by FOOTNOTE9'; footnote9 height=5 color=red box=3 blank=yes bcolor=red color=blue angle=-15 'FOOTNOTE9 is Angled in a Red Box'; footnote10 justify=right 'GR11N03 '; /* display the footnotes */ proc gslide border des='GR11N03-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR11N04 | | TITLE: REFERENCE GUIDE CHAPTER 11 OUTPUT 04 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS GSLIDE | | PROCS: GSLIDE | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htext=3; /* define footnotes */ footnote1 justify=left height=20 font=math ' m' move=(+0,+11) height=3 font=swissb 'SIZE - 1' move=(-14,-16) '1' move=(+3,+8) '(SIZE - I - 1) dl'; footnote2 justify=right 'GR11N04 '; /* display footnotes */ proc gslide des='GR11N04-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR12N01 | | TITLE: REFERENCE GUIDE CHAPTER 12 OUTPUT 01 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS AXIS SYMBOL GPLOT | | PROCS: GPLOT | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3 colors=(red green) ctext=blue ctitle=white; /* create the data set */ data sample; input x y; cards; 1 2 2 4 3 1.5 4 3 ; run; /* define footnotes and titles */ footnote j=l 'Data from WORK.SAMPLE' j=r 'GR12N01 '; title 'Plot of Y*X'; /* define symbol characteristics */ symbol h=5; axis1 length=7 in; /* produce the plot of Y*X */ proc gplot data=sample; plot y*x / haxis=axis1 des='GR12N01-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR12N02 | | TITLE: REFERENCE GUIDE CHAPTER 12 OUTPUT 02 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS AXIS SYMBOL GPLOT | | PROCS: GPLOT | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3 hsize=5 in vsize=5 in colors=(red green) ctext=blue ctitle=white; /* create the data set */ data sample; input x y; cards; 1 2 2 4 3 1.5 4 3 ; run; /* define title and footnotes */ title 'Plot of Y*X'; footnote j=l 'Data from WORK.SAMPLE' j=r 'GR12N02 '; /* define all symbol and axis characteristics */ axis1 length=4 in; symbol h=5; /* produce the plot of Y*X */ proc gplot data=sample; plot y*x / haxis=axis1 des='GR12N02-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR12N03 | | TITLE: REFERENCE GUIDE CHAPTER 12 OUTPUT 03 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS AXIS SYMBOL GPLOT | | PROCS: GPLOT | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3 colors=(red green) ctext=blue ctitle=black targetdevice=qms800; /* create the data set */ data sample; input x y; cards; 1 2 2 4 3 1.5 4 3 ; run; /* define all footnotes and titles */ footnote j=l 'Data from WORK.SAMPLE' j=r 'GR12N03 '; title 'Plot of Y*X'; /* define axis and symbol characteristics */ axis1 length=4 in; symbol h=5; /* produce the plot of Y*X */ proc gplot data=sample; plot y*x / haxis=axis1 des='GR12N03-1'; run; quit; goptions reset=all; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR13N01 | | TITLE: REFERENCE GUIDE CHAPTER 13 OUTPUT 01 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS AXIS PATTERN GCHART | | PROCS: GCHART | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create data set TOTALS */ data totals; length dept $ 7 site $ 8; input dept site sales; cards; Parts Sydney 7843.97 Parts Atlanta 9225.26 Parts Paris 4643.97 Repairs Sydney 6092.82 Repairs Atlanta 10210.21 Repairs Paris 7891.98 Tools Sydney 5017.36 Tools Atlanta 6254.18 Tools Paris 6611.70 Parts Sydney 5023.44 Parts Atlanta 11595.07 Parts Paris 8158.29 Repairs Sydney 6005.31 Repairs Atlanta 7789.59 Repairs Paris 6938.56 Tools Sydney 8245.17 Tools Atlanta 3003.99 Tools Paris 7268.34 Parts Sydney 10537.96 Parts Atlanta 7047.91 Parts Paris 5989.85 Repairs Sydney 4726.46 Repairs Atlanta 5411.66 Repairs Paris 6010.38 Tools Sydney 4067.10 Tools Atlanta 6248.52 Tools Paris 9717.96 Parts Sydney 10565.57 Parts Atlanta 9588.51 Parts Paris 6909.08 Repairs Sydney 10312.99 Repairs Atlanta 7488.30 Repairs Paris 3930.37 Tools Sydney 2075.74 Tools Atlanta 3624.19 Tools Paris 6414.25 ; run; /* define title and footnote */ title 'Total Sales by Department and Branch'; footnote justify=r 'GR13N01 '; footnote2 angle=-90; /* define axis characteristics */ axis1 label=('Branch'); axis2 label=none order=(0 to 90000 by 15000) minor=(number=4); /* define pattern characteristics */ pattern1 value=solid color=blue; pattern2 value=solid color=green; pattern3 value=solid color=red; /* create chart */ proc gchart data=totals; format sales dollar8.; hbar site / type=sum sumvar=sales midpoints='Atlanta' 'Sydney' 'Paris' maxis=axis1 raxis=axis2 sum subgroup=dept space=2 frame des='GR13N01-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR13N02 | | TITLE: REFERENCE GUIDE CHAPTER 13 OUTPUT 02 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS AXIS PATTERN LEGEND GCHART | | PROCS: GCHART | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create data set TOTALS */ data totals; length dept $ 7 site $ 8; input dept site sales; cards; Parts Sydney 7843.97 Parts Atlanta 9225.26 Parts Paris 4643.97 Repairs Sydney 6092.82 Repairs Atlanta 10210.21 Repairs Paris 7891.98 Tools Sydney 5017.36 Tools Atlanta 6254.18 Tools Paris 6611.70 Parts Sydney 5023.44 Parts Atlanta 11595.07 Parts Paris 8158.29 Repairs Sydney 6005.31 Repairs Atlanta 7789.59 Repairs Paris 6938.56 Tools Sydney 8245.17 Tools Atlanta 3003.99 Tools Paris 7268.34 Parts Sydney 10537.96 Parts Atlanta 7047.91 Parts Paris 5989.85 Repairs Sydney 4726.46 Repairs Atlanta 5411.66 Repairs Paris 6010.38 Tools Sydney 4067.10 Tools Atlanta 6248.52 Tools Paris 9717.96 Parts Sydney 10565.57 Parts Atlanta 9588.51 Parts Paris 6909.08 Repairs Sydney 10312.99 Repairs Atlanta 7488.30 Repairs Paris 3930.37 Tools Sydney 2075.74 Tools Atlanta 3624.19 Tools Paris 6414.25 ; run; /* define title and footnote */ title 'Total Sales by Department and Branch'; footnote1 justify=r 'GR13N02 '; footnote2 angle=-90; /* define axis characteristics */ axis1 label=('Branch'); axis2 label=none minor=(number=4) order=(0 to 90000 by 15000); /* define pattern characteristics */ pattern1 value=solid color=blue; pattern2 value=solid color=green; pattern3 value=solid color=red; /* define legend characteristics */ legend label=('Department') /* define legend label */ frame /* define a border */ position=(top center) /* position legend */ offset=(-5,-6) /* adjust position */ value=(tick=1 color=blue /* specify colors for legend */ tick=2 color=green /* value descriptions */ tick=3 color=red) shape=bar(5,4); /* modify size of legend values */ /* create chart and assign LEGEND definition */ proc gchart data=totals; format sales dollar8.; hbar site / type=sum sumvar=sales midpoints='Atlanta' 'Sydney' 'Paris' maxis=axis1 raxis=axis2 sum subgroup=dept space=2 frame legend=legend1 des='GR13N02-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR13N03 | | TITLE: REFERENCE GUIDE CHAPTER 13 OUTPUT 03 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS AXIS LEGEND SYMBOL GPLOT | | PROCS: GPLOT | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create the data set CITYTEMP */ data citytemp; input date date7. month season f1 /* Raleigh, North Carolina */ f2 /* Minneapolis, Minnesota */ f3; /* Phoenix, Arizona */ /* restructure data so that there is */ /* one observation for each city */ drop date season f1-f3; faren=f1; city='Raleigh'; output; faren=f2; city='Minn'; output; faren=f3; city='Phoenix'; output; cards; 01JAN83 1 1 40.5 12.2 52.1 01FEB83 2 1 42.2 16.5 55.1 01MAR83 3 2 49.2 28.3 59.7 01APR83 4 2 59.5 45.1 67.7 01MAY83 5 2 67.4 57.1 76.3 01JUN83 6 3 74.4 66.9 84.6 01JUL83 7 3 77.5 71.9 91.2 01AUG83 8 3 76.5 70.2 89.1 01SEP83 9 4 70.6 60.0 83.8 01OCT83 10 4 60.2 50.0 72.2 01NOV83 11 4 50.0 32.4 59.8 01DEC83 12 1 41.2 18.6 52.5 ; run; /* define titles and footnotes */ title1 'Average Monthly Temperature'; title2 h=4 'Minneapolis, Phoenix, and Raleigh'; footnote1 j=l ' Source: 1984 American Express'; footnote2 j=l ' Appointment Book' j=r 'GR13N03 '; /* define symbol characteristics */ symbol1 color=green interpol=spline width=2 value=triangle height=3; symbol2 color=blue interpol=spline width=2 value=circle height=3; symbol3 color=red interpol=spline width=2 value=square height=3; /* define axis characteristics */ axis1 label=none value=('JAN' 'FEB' 'MAR' 'APR' 'MAY' 'JUN' 'JUL' 'AUG' 'SEP' 'OCT' 'NOV' 'DEC') minor=none offset=(2) width=3; axis2 label=('Degrees' justify=r 'Fahrenheit') order=(0 to 100 by 10) minor=(number=1) width=3; /* define legend characteristics */ legend across=1 /* order entries in a column */ cborder=blue /* define a border */ position=(bottom inside center) /* position legend */ offset=(0,7) /* adjust position */ mode=share /* allow legend to share */ /* axis area */ label=none /* suppress legend label */ value=(tick=1 'Minneapolis') /* modify first value */ /* description */ shape=symbol(7,3); /* modify legend value size */ /* create plot and assign LEGEND definition */ proc gplot data=citytemp ; plot faren*month=city / cframe=lig haxis=axis1 vaxis=axis2 caxis=blue legend=legend1 des='GR13N03-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR13N04 | | TITLE: REFERENCE GUIDE CHAPTER 13 OUTPUT 04 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS AXIS LEGEND PATTERN GCHART | | PROCS: GCHART | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment and specify */ /* size and orientation of legend block */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3 offshadow=(1.5,1.5); /* create data set TOTALS */ data totals; length dept $ 7 site $ 8; input dept site sales; cards; Parts Sydney 7843.97 Parts Atlanta 9225.26 Parts Paris 4643.97 Repairs Sydney 6092.82 Repairs Atlanta 10210.21 Repairs Paris 7891.98 Tools Sydney 5017.36 Tools Atlanta 6254.18 Tools Paris 6611.70 Parts Sydney 5023.44 Parts Atlanta 11595.07 Parts Paris 8158.29 Repairs Sydney 6005.31 Repairs Atlanta 7789.59 Repairs Paris 6938.56 Tools Sydney 8245.17 Tools Atlanta 3003.99 Tools Paris 7268.34 Parts Sydney 10537.96 Parts Atlanta 7047.91 Parts Paris 5989.85 Repairs Sydney 4726.46 Repairs Atlanta 5411.66 Repairs Paris 6010.38 Tools Sydney 4067.10 Tools Atlanta 6248.52 Tools Paris 9717.96 Parts Sydney 10565.57 Parts Atlanta 9588.51 Parts Paris 6909.08 Repairs Sydney 10312.99 Repairs Atlanta 7488.30 Repairs Paris 3930.37 Tools Sydney 2075.74 Tools Atlanta 3624.19 Tools Paris 6414.25 ; run; /* define title and footnote */ title 'Total Sales by Department and Branch'; footnote justify=r 'GR13N04 '; /* define axis characteristics */ axis1 label=none origin=(25,) length=48.2 minor=none; /* define pattern characteristics */ pattern1 value=solid color=blue; pattern2 value=solid color=green; pattern3 value=solid color=red; /* define legend characteristics */ legend1 cborder=red /* specify a border */ cshadow=red /* specify block effect */ origin=(25,) /* adjust legend position */ label=none /* suppress legend label */ shape=bar(3,5); /* modify size of legend value */ /* create chart and assign LEGEND definition */ proc gchart data=totals; format sales dollar8.; vbar site / type=sum caxis=red maxis=axis1 raxis=axis1 space=4 noheading sumvar=sales midpoints='Atlanta' 'Sydney' 'Paris' subgroup=dept legend=legend1 des='GR13N04-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR13N05 | | TITLE: REFERENCE GUIDE CHAPTER 13 OUTPUT 05 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS MAPS PATTERN LEGEND GMAP GPROJECT | | PROCS: FORMAT GPROJECT GMAP | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: EDIT AND UNCOMMENT THE LIBNAME STATEMENT, | | libname maps 'SAS-data-library';, IF THE | | LIBREF HAS NOT BEEN DEFINED. | +-------------------------------------------------------------+*/ /* define the libref maps */ /*libname maps 'SAS-MAPS-library';*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create the response data set */ data ncdata; length county 4; input county members; cards; 001 4412 003 . 005 . 007 . 009 299 011 . 013 1242 015 2100 017 486 019 2266 021 17422 023 4441 025 207 027 2153 029 391 031 940 033 . 035 11949 037 977 039 207 041 3497 043 . 045 2149 047 . 049 18788 051 42875 053 . 055 . 057 514 059 1216 061 393 063 38022 065 9170 067 90229 069 404 071 8844 073 692 075 205 077 3018 079 . 081 70179 083 239 085 267 087 7701 089 858 091 2315 093 . 095 . 097 572 099 . 101 220 103 . 105 489 107 1905 109 1021 111 3995 113 2627 115 . 117 2810 119 62543 121 . 123 453 125 389 127 . 129 4534 131 . 133 14994 135 508 137 . 139 779 141 . 143 486 145 454 147 5354 149 . 151 102 153 1702 155 11363 157 2320 159 3565 161 1503 163 . 165 1881 167 701 169 . 171 2314 173 944 175 3478 177 . 179 1493 181 865 183 232646 185 . 187 4611 189 . 191 14189 193 1252 195 1676 197 . 199 2224 ; run; /* create the map data set */ data ncmap; set maps.counties; if density < 5; if state = stfips('nc'); if state > stfips('nc') then stop; drop state density; run; /* project the map data set */ proc gproject data=ncmap out=newmap; id county; run; /* define formats */ proc format; value memfmt low-1000 = 'Less than 1,000' 1001-5000 = '1,001 to 5,000' 5001-10000 = '5,001 to 10,000' 10001-15000 = '10,001 to 15,000' 15001-20000 = '15,001 to 20,000' 20001-high = '20,001 and up'; run; /* define titles and footnote */ title1 'Credit Union Members'; title2 'North Carolina, 1980'; footnote justify=l ' Source: U.S. Bureau of the Census' justify=r 'GR13N05 '; /* define pattern characteristics */ pattern1 value=solid color=blue; pattern2 value=solid color=red; pattern3 value=solid color=green; pattern4 value=solid color=lib; pattern5 value=solid color=pink; pattern6 value=solid color=lig; /* define legend characteristics */ legend across=2 /* order entries in two columns */ origin=(2,20) /* locate legend */ mode=share /* allow legend in procedure */ /* output area */ label=(position=top /* position legend label */ justify=left 'Number of Members') /* specify text of legend label */ shape=bar(3,3); /* modify legend value size */ /* create map and assign LEGEND definition */ proc gmap map=newmap data=ncdata all; format members memfmt.; id county; choro members / discrete legend=legend cempty=gray coutline=gray des='GR13N05-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR14N01 | | TITLE: REFERENCE GUIDE CHAPTER 14 OUTPUT 01 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS GSLIDE | | PROCS: GSLIDE | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* define titles and footnotees */ title1 h=3 j=left ' Title Area'; title2 h=6 'The NOTE Statement'; footnote1 j=left ' Footnote Area'; footnote2 j=right 'GR14N01 '; /* display titles, footnotes, and notes */ proc gslide frame des='GR14N01-1'; note ' Procedure Output Area'; note lspace=10; note ' The NOTE statement puts text on a graph.' justify=left ' By default, the text is left-justified at the' justify=left ' top left of the procedure output area.' justify=left ' ' justify=left ' Options in the statement allow you to control' justify=left ' the appearance and placement of the notes.'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR14N02 | | TITLE: REFERENCE GUIDE CHAPTER 14 OUTPUT 02 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS GSLIDE | | PROCS: GSLIDE | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* define titles and footnotes */ title1 'Schedule of Classes'; title2 'S p r i n g S e m e s t e r'; footnote1 justify=left ' State University'; footnote2 justify=right 'GR14N02 '; /* show the titles, footnotes, and notes */ proc gslide border des='GR14N02-1'; note height=4 move=(15,70) 'English 261' move=(50,70) 'MWF' move=(70,70) '2:00-2:50' move=(15,60) 'Math 111' move=(50,60) 'TTH' move=(70,60) '7:50-9:00' move=(15,50) 'Philosophy 334' move=(50,50) 'MWF' move=(70,50) '9:00-9:50' move=(15,40) 'Biology 100' move=(50,40) 'TTH' move=(70,40) '2:20-4:00' move=(15,30) 'Computer Science 101' move=(50,30) 'MWF' move=(70,30) '11:00-11:50'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR14N03 | | TITLE: REFERENCE GUIDE CHAPTER 14 OUTPUT 03 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS GSLIDE | | PROCS: GSLIDE | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6; /* define footnote */ footnote h=3 j=r 'GR14N03 '; /* set text height */ goptions htext=6; /* show footnotes and notes */ proc gslide des='GR14N03-1'; note ' Mass Absorption Coefficients, ' font=greek 'a/r' font=swissb ','; note ' (cm' height=5 move=(+.6,+2) '2' move=(-.6,-2) height=6 '/gm)' ' for a Cu K' move=(+.6,-2) font=greek 'a' move=(-.6,+2) font=swissb ' x-ray at 1.539 A' font=special move=(-2.4,+2.5) '0'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR15N01 | | TITLE: REFERENCE GUIDE CHAPTER 15 OUTPUT 01 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS PATTERN GCHART | | PROCS: GCHART | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create data set QTRTOT */ data qtrtot; length region $ 5; input quarter region $ sales; cards; 1 North 2706 1 South 1927 1 East 2186 1 West 2498 2 North 2337 2 South 1762 2 East 2049 2 West 2611 3 North 2583 3 South 2164 3 East 1836 3 West 2319 4 North 2847 4 South 2216 4 East 1693 4 West 2502 ; run; /* define title and footnote */ title 'Bar/Block Patterns in a Chart'; footnote j=r 'GR15N01 '; /* define pattern characteristics */ pattern1 color=blue value=solid; pattern2 color=green value=solid; pattern3 color=red value=solid; /* generate bar chart with patterns */ proc gchart data=qtrtot; vbar quarter / discrete sumvar=sales subgroup=region width=8 des='GR15N01-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR15N02 | | TITLE: REFERENCE GUIDE CHAPTER 15 OUTPUT 02 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS MAPS PATTERN GMAP | | PROCS: GMAP | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: EDIT AND UNCOMMENT THE LIBNAME STATEMENT, | | libname maps 'SAS-data-library';, IF THE | | LIBREF HAS NOT BEEN DEFINED. | +-------------------------------------------------------------+*/ /* define the libref maps */ /*libname maps 'SAS-MAPS-library';*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create map data set STATES */ data states; set maps.us; where state=04 or state=22 or state=35 or state=48 or state=40; run; /* define title and footnotes */ title 'Map/Plot Patterns in a Choropleth Map'; footnote1 j=l ' US map data set supplied' ' with SAS/GRAPH' '02'x ' software'; footnote2 j=r 'GR15N02 '; /* define pattern characteristics */ pattern1 value=msolid color=red; pattern2 value=msolid color=green; pattern3 value=msolid color=blue; /* display the map data set */ proc gmap map=states data=states; id state; choro state / discrete nolegend des='GR15N02-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR15N03 | | TITLE: REFERENCE GUIDE CHAPTER 15 OUTPUT 03 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS AXIS SYMBOL PATTERN GPLOT | | PROCS: GPLOT | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create the data set CITYTEMP */ data citytemp; input date date7. month season f1 f2 f3; drop date season; cards; 01JAN83 1 1 40.5 12.2 52.1 01FEB83 2 1 42.2 16.5 55.1 01MAR83 3 2 49.2 28.3 59.7 01APR83 4 2 59.5 45.1 67.7 01MAY83 5 2 67.4 57.1 76.3 01JUN83 6 3 74.4 66.9 84.6 01JUL83 7 3 77.5 71.9 91.2 01AUG83 8 3 76.5 70.2 89.1 01SEP83 9 4 70.6 60.0 83.8 01OCT83 10 4 60.2 50.0 72.2 01NOV83 11 4 50.0 32.4 59.8 01DEC83 12 1 41.2 18.6 52.5 ; run; /* define title and footnotes */ title 'Map and Plot Patterns in a Plot'; footnote1 j=l ' Source: 1984 American Express'; footnote2 j=l ' Appointment Book' j=r 'GR15N03 '; /* define symbol characteristics */ symbol1 color=blue interpol=join; symbol2 color=red interpol=join; symbol3 color=green interpol=join; /* define axis characteristics */ axis1 offset=(1) minor=none width=3; axis2 offset=(1) minor=none width=3; /* define pattern characteristics */ pattern value=solid; /* generate a plot of three variables */ proc gplot data=citytemp; plot (f2 f1 f3)*month / haxis=axis1 vaxis=axis2 areas=3 overlay frame des='GR15N03-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR15N04 | | TITLE: REFERENCE GUIDE CHAPTER 15 OUTPUT 04 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS PATTERN GCHART | | PROCS: GCHART | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create example data set */ data totals; length office $ 5; input office $ sales; cards; North 270653 South 192714 East 218621 West 249887 ; run; /* define title and footnote */ title 'Pie/Star Patterns in a Pie Chart'; footnote j=r 'GR15N04 '; /* define pattern characteristics */ pattern1 color=blue value=psolid; pattern2 color=red value=psolid; pattern3 color=green value=psolid; /* generate pie chart with patterns */ proc gchart data=totals; pie office / type=sum sumvar=sales des='GR15N04-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR15N05 | | TITLE: REFERENCE GUIDE CHAPTER 15 OUTPUT 05 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS MAPS PATTERN GMAP | | PROCS: GMAP | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: EDIT AND UNCOMMENT THE LIBNAME STATEMENT, | | libname maps 'SAS-data-library';, IF THE | | LIBREF HAS NOT BEEN DEFINED. | +-------------------------------------------------------------+*/ /* define the libref maps */ /*libname maps 'SAS-MAPS-library';*/ /* set the graphics environment */ /* and define a colors list */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3 colors=(white blue green red lib lig pink); /* create response data set SITES */ data sites; input state sites; cards; 04 620 35 600 40 700 48 917 ; run; /* create map data set STATES */ data states; set maps.us; where state=04 or state=35 or state=40 or state=48; run; /* define title and footnotes */ title 'Bar/Block and Map/Plot Patterns in a Map'; footnote1 j=l ' US map data set supplied' ' with SAS/GRAPH' '02'x ' software'; footnote2 j=r 'GR15N05 '; /* define pattern characteristics */ pattern1 value=l3; pattern2 value=msolid; pattern3 value=x3; /* display the map data set */ proc gmap map=states data=sites; id state; block sites / levels=8 area=1 des='GR15N05-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR16N01 | | TITLE: REFERENCE GUIDE CHAPTER 16 OUTPUT 01 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS SYMBOL GPLOT | | PROCS: GPLOT | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create the data set STATS */ data stats; input height weight; cards; 69.0 112.5 56.5 84.0 65.3 98.0 62.8 102.5 63.5 102.5 57.3 83.0 59.8 84.5 62.5 112.5 62.5 84.0 59.0 99.5 51.3 50.5 64.3 90.0 56.3 77.0 66.5 112.0 72.0 150.0 64.8 128.0 67.0 133.0 57.5 85.0 ; run; /* define title and footnotes */ title 'Study of Height vs Weight'; footnote1 j=r 'GR16N01 ' j=l ' Source: T. Lewis & L. R. Taylor'; footnote2 j=l ' Introduction to Experimental Ecology'; /* define symbol characteristics */ symbol interpol=rcclm95 /* regression analysis with */ /* confidence limits */ value=diamond /* plot symbol */ height=3 /* plot symbol height */ cv=red /* plot symbol color */ ci=blue /* regression line color */ co=green /* confidence limits color */ width=2; /* line width */ /* produce plot */ proc gplot data=stats; plot height*weight / haxis=45 to 155 by 10 vaxis=48 to 78 by 6 hminor=1 des='GR16N01-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR16N02 | | TITLE: REFERENCE GUIDE CHAPTER 16 OUTPUT 02 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS AXIS SYMBOL GPLOT | | PROCS: GPLOT | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create the data set HILO */ /* structure the data set so that each value */ /* of DOW is in a separate observation */ data hilo; input date date7. @18 high low close; format date date7.; drop high low close; dow=high; output; dow=low; output; dow=close; output; cards; 03AUG81 3219.3 955.48 940.45 946.25 04AUG81 2938.5 951.39 937.40 945.97 05AUG81 4177.8 958.81 942.16 953.58 06AUG81 3975.7 961.47 947.30 952.91 07AUG81 3884.3 954.15 938.45 942.54 10AUG81 2937.7 948.82 935.88 943.68 11AUG81 5262.9 955.48 939.50 949.30 12AUG81 4005.2 955.86 942.26 945.21 13AUG81 3680.8 952.91 938.55 944.35 14AUG81 3714.1 947.77 933.79 936.93 17AUG81 3432.7 939.40 924.37 926.75 18AUG81 4396.7 932.74 916.38 924.37 19AUG81 3517.3 932.08 918.38 926.46 20AUG81 3811.9 935.31 923.52 928.37 21AUG81 2625.9 930.65 917.14 920.57 24AUG81 4736.1 917.43 896.97 900.11 25AUG81 4714.4 904.30 887.46 901.83 26AUG81 3279.6 908.39 893.65 899.26 27AUG81 3676.1 900.49 883.66 889.08 28AUG81 3024.2 898.78 884.80 892.22 ; run; /* define titles and footnote */ title1 'Dow Jones High-Low-Close'; title2 h=4 'August, 1981'; footnote j=r 'GR16N02 '; /* define symbol characteristics */ symbol interpol=hiloctj /* high-low plot with close values */ cv=blue /* color for hilo line */ ci=red /* color for join line for close values */ width=2; /* width of join line */ /* define axis characteristics */ axis1 order=('02AUG81'd to '30AUG81'd by week) label=none major=(height=2) minor=(number=6 height=1) offset=(3) width=3; axis2 order=(880 to 970 by 10) label=none major=(height=1.5) minor=(number=4 height=1) offset=(3) width=3; /* generate plot */ proc gplot data=hilo; plot dow*date / frame haxis=axis1 vaxis=axis2 des='GR16N02-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR16N03 | | TITLE: REFERENCE GUIDE CHAPTER 16 OUTPUT 03 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS AXIS SYMBOL GPLOT | | PROCS: SORT GPLOT | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create the data set STOCKS */ data stocks; input year @15 high @32 low; cards; 1954 31DEC54 404.39 11JAN54 279.87 1955 30DEC55 488.40 17JAN55 388.20 1956 06APR56 521.05 23JAN56 462.35 1957 12JUL57 520.77 22OCT57 419.79 1958 31DEC58 583.65 25FEB58 436.89 1959 31DEC59 679.36 09FEB59 574.46 1960 05JAN60 685.47 25OCT60 568.05 1961 13DEC61 734.91 03JAN61 610.25 1962 03JAN62 726.01 26JUN62 535.76 1963 18DEC63 767.21 02JAN63 646.79 1964 18NOV64 891.71 02JAN64 768.08 1965 31DEC65 969.26 28JUN65 840.59 1966 09FEB66 995.15 07OCT66 744.32 1967 25SEP67 943.08 03JAN67 786.41 1968 03DEC68 985.21 21MAR68 825.13 1969 14MAY69 968.85 17DEC69 769.93 1970 29DEC70 842.00 06MAY70 631.16 1971 28APR71 950.82 23NOV71 797.97 1972 11DEC72 1036.27 26JAN72 889.15 1973 11JAN73 1051.70 05DEC73 788.31 1974 13MAR74 891.66 06DEC74 577.60 1975 15JUL75 881.81 02JAN75 632.04 1976 21SEP76 1014.79 02JAN76 858.71 1977 03JAN77 999.75 02NOV77 800.85 1978 08SEP78 907.74 28FEB78 742.12 1979 05OCT79 897.61 07NOV79 796.67 1980 20NOV80 1000.17 21APR80 759.13 1981 27APR81 1024.05 25SEP81 824.01 1982 27DEC82 1070.55 12AUG82 776.92 1983 29NOV83 1287.20 03JAN83 1027.04 1984 06JAN84 1286.64 24JUL84 1086.57 1985 16DEC85 1553.10 04JAN85 1184.96 1986 02DEC86 1955.57 22JAN86 1502.29 1987 25AUG87 2722.42 19OCT87 1738.74 ; run; /* restructure the data so that */ /* it defines a closed area */ /* create the data sets HIGH and LOW */ data high(keep=year value) low(keep=year value); set stocks; value=high; output high; value=low; output low; /* reverse order of the observations in LOW */ proc sort data=low; by descending year; /* concatenate HIGH and LOW to create data set AREA */ data area; set high low; /* define titles and footnote */ title1 'Dow Jones Industrial Average'; title2 h=4 'Highs and Lows From 1954 to 1987'; footnote j=l ' Source: 1988 World Almanac' j=r 'GR16N03 '; /* define symbol characteristics */ symbol interpol=m3n90 /* map/plot pattern fill */ cv=red /* pattern fill color */ co=blue /* outline color */ value=none; /* plot symbol suppressed */ /* define axis characteristics */ axis1 order=(1954 to 1990 by 4) label=none major=(height=2) minor=(number=3 height=1) offset=(0,) width=3; axis2 order=(200 to 2800 by 200) label=none major=(height=1.5) minor=(number=1 height=1) width=3; /* generate plot using data set AREA */ proc gplot data=area; plot value*year / haxis=axis1 vaxis=axis2 frame des='GR16N03-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR16N04 | | TITLE: REFERENCE GUIDE CHAPTER 16 OUTPUT 04 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS AXIS SYMBOL GPLOT | | PROCS: GPLOT | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create the data set GRADES */ data grades; input section $ grade @@; cards; A 74 A 89 A 91 A 76 A 87 A 93 A 93 A 96 A 55 B 72 B 72 B 84 B 81 B 97 B 78 B 88 B 90 B 74 C 62 C 74 C 71 C 87 C 68 C 78 C 80 C 85 C 82 ; run; /* define title and footnote */ title 'Comparison of Grades by Section'; footnote j=r 'GR16N04 '; /* define symbol characteristics */ symbol interpol=boxt10 /* box plot */ cv=red /* plot symbol color */ co=blue /* box and whisker color */ width=6 /* line width */ value=square /* plot symbol */ height=4; /* symbol height */ /* define axis characteristics */ axis1 value=('Monday' 'Wednesday' 'Friday') offset=(5,5) length=50; /* generate plot */ proc gplot data=grades; plot grade*section / haxis=axis1 vaxis=50 to 100 by 10 frame des='GR16N04-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR16N05 | | TITLE: REFERENCE GUIDE CHAPTER 16 OUTPUT 05 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS SYMBOL GPLOT | | PROCS: GPLOT | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create the data set HILO */ data hilo; input x y @@; cards; 1 1 1 2 1 3 1 4 1 5 2 2 2 4 2 6 2 1 2 2 3 2 3 3 3 6 3 1 3 13 4 1 4 8 4 3 4 1 4 2 5 3 5 2 5 3 5 4 5 3 ; run; /* create the graph illustrating MODE=EXCLUDE */ /* define title and footnotes */ title 'SYMBOL Statement: MODE=EXCLUDE'; footnote1 j=c 'Observation at (3,13) is off the graph'; footnote2 j=c 'Calculated MEAN does not reflect omitted observation'; footnote3 j=r 'GR16N05(a) '; /* define symbol characteristics */ symbol interpol=hilotj /* high-low plot */ mode=exclude /* exclude omitted values */ ci=blue /* color for join line */ width=3 /* line width */ font=marker /* font for plot symbol */ value=U /* plot symbol */ cv=red; /* plot symbol color */ /* generate plot */ proc gplot data=hilo; plot y*x / frame haxis=0 to 6 vaxis=0 to 10 hminor=0 vminor=0 des='GR16N05-1'; run; /* create the graph illustrating MODE=INCLUDE */ /* define title and footnotes */ title 'SYMBOL Statement: MODE=INCLUDE'; footnote1 'Observation at (3,13) is off the graph'; footnote2 'Calculated MEAN reflects omitted observation'; footnote3 j=r 'GR16N05(b) '; /* modify symbol definition to include omitted values */ symbol mode=include; /* generate plot */ proc gplot data=hilo; plot y*x / frame haxis=0 to 6 vaxis=0 to 10 hminor=0 vminor=0 des='GR16N05-2'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR17N01 | | TITLE: REFERENCE GUIDE CHAPTER 17 OUTPUT 01 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS GSLIDE | | PROCS: GSLIDE | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* define titles */ title1 'Title Size & Positions (TITLE1)' justify=left height=3 ' Title Area'; title2 'TITLE2'; title3 'TITLE3'; title4 'TITLE4'; title5 'TITLE5'; title6 'TITLE6'; title7 'TITLE7'; title8 'TITLE8'; title9 'TITLE9'; title10 'TITLE10'; /* define footnotes */ footnote1 justify=left ' Footnote Area'; footnote2 justify=right 'GR17N01 '; /* display titles, footnotes, and note */ proc gslide frame des='GR17N01-1'; note ' Procedure Output Area'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR17N02 | | TITLE: REFERENCE GUIDE CHAPTER 17 OUTPUT 02 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS GSLIDE | | PROCS: GSLIDE | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htext=3; /* define titles */ title1 lspace=8 height=10 box=1 'ANNOUNCEMENT'; title2 lspace=8 font=swiss height=8 'Monday Is a Legal Holiday'; title3 font=swiss height=8 'We Will Be Closed'; title4 lspace=6 font=script justify=right height=8 'The Management '; /* define footnote */ footnote j=right 'GR17N02 '; /* display titles and footnote */ proc gslide des='GR17N02-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR17N03 | | TITLE: REFERENCE GUIDE CHAPTER 17 OUTPUT 03 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS GSLIDE | | PROCS: GSLIDE | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htext=3; /* define titles */ title1 height=5 justify=left ' SAS Institute Inc.' justify=left " Run Date: &SYSDATE" justify=left " Run Time: &SYSTIME" justify=center 'Text Positioning' justify=right 'Page 1 ' justify=right 'Version 6 '; title2 height=2 'D ' height=2.5 'i ' height=3 'f ' height=3.5 'f ' height=4 'e ' height=4.5 'r ' height=5 'e ' height=5.5 'n ' height=6 't ' height=6.5 ' heights'; title3 justify=left height=6 ' Left' justify=center 'Center' justify=right 'Right '; /* define footnote */ footnote j=right 'GR17N03 '; /* display the titles and footnote */ proc gslide des='GR17N03-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR17N04 | | TITLE: REFERENCE GUIDE CHAPTER 17 OUTPUT 04 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS GSLIDE | | PROCS: GSLIDE | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* define titles */ title1 underlin=3 'VERTEBRATES'; title2 lspace=6 ' ' move=(23,+0) height=5 underlin=2 ' Birds ' move=(43,+0) underlin=2 ' Reptiles ' move=(63,+0) underlin=2 ' Mammals '; /* define footnotes */ footnote1 ' ' draw=(41.5,+5,41.5,90) draw=(61.5,+5,61.5,90); footnote2 height=4 'Selected Creatures'; footnote3 j=right 'GR17N04 '; /* display titles, footnotes, and notes */ proc gslide border des='GR17N04-1'; note lspace=3; note ' ' move=(25,+0) height=4 'Turkey ' move=(45,+0) 'Snake ' move=(65,+0) 'Mouse '; note ' ' move=(25,+0) height=4 'Buzzard' move=(45,+0) 'Lizard ' move=(65,+0) 'Deer '; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR17N05 | | TITLE: REFERENCE GUIDE CHAPTER 17 OUTPUT 05 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS GSLIDE | | PROCS: GSLIDE | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htext=3; /* define titles */ title1 height=5 'This is TITLE1'; title3 height=5 underlin=1 'TITLE3 Is' color=red ' Underlined'; title5 height=5 color=red angle=-90 'TITLE5 is Angled -90'; title7 height=5 color=red rotate=25 'TITLE7 is Rotated'; title8 height=5 color=green box=1 'TITLE8 is Boxed'; title9 height=5 color=red box=3 blank=yes bcolor=red color=blue angle=-25 'TITLE9 is Angled in a Red Box'; title10 height=5 color=red box=1 bcolor=blue move=(5,20) font=script 'TITLE10 is in Script and ' move=(10,12) height=3 'is Partially Boxed, Positioned with Explicit Moves,' move=(15,8) 'and Overlaid by TITLE9'; /* define footnote */ footnote justify=right 'GR17N05 '; /* display titles and footnote */ proc gslide des='GR17N05-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR17N06 | | TITLE: REFERENCE GUIDE CHAPTER 17 OUTPUT 06 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS GSLIDE | | PROCS: GSLIDE | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* define title */ title 'Relationship of pH to H' move=(-0,-3) height=4 '3' move=(+0,+3) height=6 'O' move=(+0,+3) height=4 '+' move=(-0,-3) height=6 ' Concentration'; /* define footnote */ footnote j=right 'GR17N06 '; /* display title and footnote */ proc gslide des='GR17N06-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR18N01 | | TITLE: REFERENCE GUIDE CHAPTER 18 OUTPUT 01 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS MAPS PATTERN ANNOTATE GMAP | | PROCS: GMAP | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: EDIT AND UNCOMMENT THE LIBNAME STATEMENT, | | libname maps 'SAS-data-library';, IF THE | | LIBREF HAS NOT BEEN DEFINED. | +-------------------------------------------------------------+*/ /* define the libref maps */ /*libname maps 'SAS-MAPS-library';*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create the Annotate data set, CITIES */ data cities; /* declare the variables */ length text $ 40 function color style $ 8; retain function 'label' xsys ysys '2' hsys '3' when 'a'; set maps.uscity; /* use only cities in NC */ if state = stfips('NC'); /* create the observations to label Asheville, */ /* Charlotte, Durham, and Wilmington */ if upcase(city)='ASHEVILLE ' or upcase(city)='CHARLOTTE ' or upcase(city)='DURHAM ' or upcase(city)='WILMINGTON' then do; /* create the observations to draw the dot */ color='red'; size=13; text='J'; position='5'; style='special'; output; /* create the observations to label the dot */ function='label'; text=city; position='6'; color='green'; style='swissb'; size=5; output; end; /* create the observations to label Raleigh */ else if upcase(city)='RALEIGH' then do; /* create the observation to draw the star */ color='blue'; size=14; text='M'; position='5'; style='special'; output; /* create the observation to label the star */ text=city; position='9'; color='green'; style='swissb'; size=5; output; end; run; /* create map data set that contains North Carolina */ data map; set maps.us; if state=stfips('NC'); run; /* define the footnote, title, */ /* and pattern characteristics */ footnote j=r 'GR18N01 '; title 'Cities of North Carolina'; pattern color=blue value=empty; /* generate annotated map of North Carolina */ proc gmap data=map map=map; id state; choro state / nolegend annotate=cities des='GR18N01-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR18N02 | | TITLE: REFERENCE GUIDE CHAPTER 18 OUTPUT 02 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS ANNOTATE GSLIDE MACRO | | PROCS: GSLIDE | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: FILENAME macs REFERS TO THE ANNOTATE MACROS, | | ANNOMAC.SAS | +-------------------------------------------------------------+*/ /* assign fileref to macros data set */ /* filename macs 'external-file'; */ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; %annomac; /* create the Annotate data set, POPTREE */ data poptree; /* length and type specification */ %dclanno; /* set length of text variable */ length text $ 16; /* window percentage for x and y */ %system(5, 5, 3); /* draw female axis lines */ %move(5, 10); %draw(40, 10, red, 1, .5); %draw(40, 95, red, 1, .5); /* draw male axis lines */ %move(56.1, 95); %draw(56.1, 10, red, 1, .5); %draw(95, 10, red, 1, .5); /* label categories */ %label(75.0, 97.0, 'Male', green, 0, 0, 4, swissb, 5); /* at top */ %label(25.0, 97.0, 'Female', green, 0, 0, 4, swissb, 5); %label(5.0, 5, '100', blue, 0, 0, 4, swissb, 5); %label(22.5, 5, ' 50', blue, 0, 0, 4, swissb, 5); %label(40.0, 5, ' 00', blue, 0, 0, 4, swissb, 5); %label(95.0, 5, '100', blue, 0, 0, 4, swissb, 5); %label(75.0, 5, ' 50', blue, 0, 0, 4, swissb, 5); %label(56.0, 5, ' 00', blue, 0, 0, 4, swissb, 5); /* label age */ %label(48.0, 15.25, 'under 20', blue, 0, 0, 4, swissb, 5); %label(48.0, 25.0, '20 - 29', blue, 0, 0, 4, swissb, 5); %label(48.0, 36.7, '30 - 39', blue, 0, 0, 4, swissb, 5); %label(48.0, 47.4, '40 - 49', blue, 0, 0, 4, swissb, 5); %label(48.0, 57.8, '50 - 59', blue, 0, 0, 4, swissb, 5); %label(48.0, 68.6, '60 - 69', blue, 0, 0, 4, swissb, 5); %label(48.0, 79.3, '70 - 79', blue, 0, 0, 4, swissb, 5); %label(48.0, 90.0, 'over 79', blue, 0, 0, 4, swissb, 5); /* male bars on right */ %bar(56.2, 10.5, 95.0, 20.0, blue, 0, solid); %bar(56.2, 20.71, 90.0, 30.71, green, 0, solid); %bar(56.2, 31.42, 80.0, 41.52, red, 0, solid); %bar(56.2, 42.14, 62.0, 52.14, blue, 0, solid); %bar(56.2, 52.85, 72.0, 62.85, green, 0, solid); %bar(56.2, 63.57, 60.0, 73.57, red, 0, solid); %bar(56.2, 74.28, 61.0, 84.28, blue, 0, solid); %bar(56.2, 85.0, 63.0, 95.0, green, 0, solid); /* label male bars on right */ %label(95.0, 20.0, '100', black, 0, 0, 4, swissb, 7); %label(90.0, 30.71, '88', black, 0, 0, 4, swissb, 7); %label(80.0, 41.52, '61', black, 0, 0, 4, swissb, 7); %label(62.0, 52.14, '18', black, 0, 0, 4, swissb, 7); %label(72.0, 62.85, '46', black, 0, 0, 4, swissb, 7); %label(60.0, 73.57, '12', black, 0, 0, 4, swissb, 7); %label(61.0, 84.28, '14', black, 0, 0, 4, swissb, 7); %label(62.0, 95.0, '18', black, 0, 0, 4, swissb, 7); /* female bars on left */ %bar(39.8, 10.5, 25.0, 20.0, blue, 0, solid); %bar(39.8, 20.71, 15.0, 30.7, green, 0, solid); %bar(39.8, 31.42, 10.0, 41.42, red, 0, solid); %bar(39.8, 42.14, 32.0, 52.14, blue, 0, solid); %bar(39.8, 52.85, 33.0, 62.85, green, 0, solid); %bar(39.8, 63.57, 36.0, 73.57, red, 0, solid); %bar(39.8, 74.28, 35.0, 84.28, blue, 0, solid); %bar(39.8, 85.0, 33.0, 95.0, green, 0, solid); /* label female bars on left */ %label(25.0, 20.0, '42', black, 0, 0, 4, swissb, 9); %label(15.0, 30.7, '77', black, 0, 0, 4, swissb, 9); %label(10.0, 41.42, '92', black, 0, 0, 4, swissb, 9); %label(32.0, 52.14, '26', black, 0, 0, 4, swissb, 9); %label(33.0, 62.85, '24', black, 0, 0, 4, swissb, 9); %label(36.0, 73.57, '13', black, 0, 0, 4, swissb, 9); %label(35.0, 84.28, '15', black, 0, 0, 4, swissb, 9); %label(33.0, 95.0, '19', black, 0, 0, 4, swissb, 9); run; /* define the footnote and titles */ footnote j=r 'GR18N02 '; title1 'Population Tree'; title2 h=4 'Distribution of Population by Sex'; /* generate annotated slide */ proc gslide annotate=poptree des='GR18N02-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR18N03 | | TITLE: REFERENCE GUIDE CHAPTER 18 OUTPUT 03 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS ANNOTATE GSLIDE | | PROCS: GSLIDE | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htext=3; /* create the Annotate data set */ data box; /* declare variables */ length function style color $ 8 text $ 25; retain hsys xsys ysys '3'; /* create the observation to draw the title */ function='label'; x=20; y=85; position='6'; style='swissb'; color='green'; size=6; text='Sample Annotate Graphics'; output; /* create the observations to draw the box */ function='move'; x=28; y=30; output; function='draw'; x=68; y=30; size=.2; line=1; color='red'; output; function='draw'; x=68; y=70; output; function='draw'; x=28; y=70; output; function='draw'; x=28; y=30; output; run; /* define the footnote */ footnote j=r 'GR18N03 '; /* draw the Annotate graphics */ proc gslide annotate=box des='GR18N03-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR18N04 | | TITLE: REFERENCE GUIDE CHAPTER 18 OUTPUT 04 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS ANNOTATE GSLIDE | | PROCS: GSLIDE | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htext=3; /* create the Annotate data set */ data boxes; /* declare the variables */ length function color style $ 8; retain hsys ysys xsys '3'; /* create the observations to draw the blue box */ function='poly'; line=1; style='msolid'; color='blue'; x=20; y=30; output; function='polycont'; x=40; y=30; output; function='polycont'; x=40; y=70; output; function='polycont'; x=20; y=70; output; function='polycont'; x=20; y=30; output; /* create the observations to draw the red box */ function='poly'; line=1; style='msolid'; color='red'; x=30; y=50; output; function='polycont'; x=50; y=50; output; function='polycont'; x=50; y=80; output; function='polycont'; x=30; y=80; output; function='polycont'; x=30; y=50; output; run; /* define the footnote */ footnote j=r 'GR18N04 '; /* produce the Annotate graphics */ proc gslide annotate=boxes des='GR18N04-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR18N05 | | TITLE: REFERENCE GUIDE CHAPTER 18 OUTPUT 05 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS ANNOTATE GSLIDE | | PROCS: GSLIDE | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htext=3; /* create the Annotate data set */ data boxes; /* declare the variables */ length function color style $ 8; retain hsys ysys xsys '3'; /* create the observations to draw the red box */ function='poly'; line=1; style='msolid'; color='red'; x=30; y=50; output; function='polycont'; x=50; y=50; output; function='polycont'; x=50; y=80; output; function='polycont'; x=30; y=80; output; function='polycont'; x=30; y=50; output; /* create the observations to draw the blue box */ function='poly'; line=1; style='msolid'; color='blue'; x=20; y=30; output; function='polycont'; x=40; y=30; output; function='polycont'; x=40; y=70; output; function='polycont'; x=20; y=70; output; function='polycont'; x=20; y=30; output; run; /* define the footnote */ footnote j=r 'GR18N05 '; /* produce the Annotate graphics */ proc gslide annotate=boxes des='GR18N05-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR18N06 | | TITLE: REFERENCE GUIDE CHAPTER 18 OUTPUT 06 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS ANNOTATE GSLIDE | | PROCS: GSLIDE | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htext=3; /* create the Annotate data set */ data boxes; /* declare the variables */ length function color style $ 8; retain hsys ysys xsys '3'; /* create the observations to draw the red box */ function='poly'; line=1; style='msolid'; color='red'; x=30; y=50; output; function='polycont'; x=50; y=50; output; function='polycont'; x=50; y=80; output; function='polycont'; x=30; y=80; output; function='polycont'; x=30; y=50; output; /* create the observations to draw the blue box */ function='poly'; line=1; style='mx1'; color='blue'; x=20; y=30; output; function='polycont'; x=40; y=30; output; function='polycont'; x=40; y=70; output; function='polycont'; x=20; y=70; output; function='polycont'; x=20; y=30; output; run; /* define the footnote */ footnote j=r 'GR18N06 '; /* produce the Annotate graphics */ proc gslide annotate=boxes des='GR18N06-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR18N07 | | TITLE: REFERENCE GUIDE CHAPTER 18 OUTPUT 07 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS ANNOTATE GSLIDE | | PROCS: GSLIDE | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htext=3; /* create the Annotate data set */ data boxes; /* declare the variables */ length function color style $ 8; retain hsys ysys xsys '3'; /* create the observations to draw the blue box */ function='poly'; line=1; style='msolid'; color='blue'; x=20; y=30; when='a'; output; function='polycont'; x=40; y=30; output; function='polycont'; x=40; y=70; output; function='polycont'; x=20; y=70; output; function='polycont'; x=20; y=30; output; /* create the observations to draw the red box */ function='poly'; line=1; style='msolid'; color='red'; x=30; y=50; when='b'; output; function='polycont'; x=50; y=50; output; function='polycont'; x=50; y=80; output; function='polycont'; x=30; y=80; output; function='polycont'; x=30; y=50; output; run; /* define the footnote */ footnote j=r 'GR18N07 '; /* produce the Annotate graphics */ proc gslide annotate=boxes des='GR18N07-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR18N08 | | TITLE: REFERENCE GUIDE CHAPTER 18 OUTPUT 08 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS ANNOTATE GSLIDE | | PROCS: GSLIDE | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create data set of units sold */ /* per city (summed data) */ data sold; input city $ units; cards; Atlanta 289 Seattle 489 Chicago 347 ; run; /* create the Annotate data set, ANNO */ data anno; length function color style $ 8; retain function 'label' color 'black' when 'a' style 'swissb' xsys ysys '2' position '5' size 5 hsys '3'; set sold; midpoint=city; text=left(put(units,5.)); y=units/2; run; /* define the title and footnote */ title 'Orders Received'; footnote j=r 'GR18N08 '; /* define axis and pattern characteristics */ axis1 label=none major=none minor=none style=0 value=none; axis2 label=none value=(font=swissb height=3); pattern value=solid color=green; /* generate vertical bar chart */ /* with the Annotate data set */ proc gchart data=sold; vbar city / type=sum sumvar=units width=17 coutline=blue annotate=anno raxis=axis1 maxis=axis2 des='GR18N08-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR18N09 | | TITLE: REFERENCE GUIDE CHAPTER 18 OUTPUT 09 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS AXIS PATTERN ANNOTATE GCHART | | PROCS: GCHART | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create data set of units sold */ /* per city (summed data) */ data sold; length type $ 10; input city $ units type $ ; cards; Atlanta 99 Printers Atlanta 105 Plotters Atlanta 85 Terminals Seattle 182 Printers Seattle 150 Plotters Seattle 157 Terminals Chicago 111 Printers Chicago 136 Plotters Chicago 100 Terminals ; run; /* create the Annotate data set, ANNO */ data anno; length function color style $ 8; retain function 'label' color 'black' when 'a' style 'swissb' xsys ysys '2' position 'E' size 4 hsys '3'; set sold; midpoint=city; subgroup=type; text=left(put(units,5.)); run; /* define the title and footnote */ title 'Orders Received'; footnote j=r 'GR18N09 '; /* define axis and pattern characteristics */ axis1 label=none major=none minor=none style=0 value=none; axis2 label=none value=(font=swissb height=3); pattern1 value=s color=blue; pattern2 value=s color=green; pattern3 value=s color=red; /* generate vertical bar chart */ /* using the Annotate data set */ proc gchart data=sold; vbar city / type=sum sumvar=units subgroup=type width=17 annotate=anno raxis=axis1 maxis=axis2 des='GR18N09-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR18N10 | | TITLE: REFERENCE GUIDE CHAPTER 18 OUTPUT 10 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS ANNOTATE GSLIDE FORMAT | | PROCS: GSLIDE FORMAT | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create data set of units */ /* sold in a city and the */ /* percent of the total */ data sold; input city $ units percent ; cards; Atlanta 289 26 Seattle 489 43 Chicago 347 31 ; run; /* set up colors */ proc format; value col 1='blue' 2='green' 3='red'; run; /* create the Annotate data set, SLICES */ data slices; length function color style $ 8; retain xsys ysys hsys '3'; set sold; /* draw each slice */ function='pie'; size=35; x=50; y=45; color=put((mod(_n_,3)+1),col.); style='solid'; rotate=percent*360/100; output; /* get coordinates for labels */ function='piexy'; hangle+rotate; angle=hangle-.5*rotate; size=1.1; output; /* pass coordinates to XLSTT,YLSTT */ function='cntl2txt'; output; /* put starting point on the stack */ function='push'; output; /* position CITY */ function='label'; rotate=0; style='swissb'; size=3; x=.; y=.; color='blue'; if 0<=angle<=90 then position='3'; else if angle<180 then position='1'; else if angle<270 then position='4'; else position='6'; text=city; tempang=angle; angle=0; output; /* get stored start coordinates */ function='pop'; output; /* position PERCENT values */ function='label'; if 0<=tempang<90 then position='6'; else if tempang=90 then position='5'; else if tempang<180 then position='4'; else if tempang<270 then position='7'; else if tempang=270 then position='8'; else position='9'; text=put(percent/100,percent8.); output; run; /* define the footnote and title */ footnote j=r 'GR18N10 '; title 'Orders Received'; /* generate the slide using */ /* the Annotate data set */ proc gslide annotate=slices des='GR18N10-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR18N11 | | TITLE: REFERENCE GUIDE CHAPTER 18 OUTPUT 11 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS ANNOTATE AXIS SYMBOL GPLOT | | PROCS: GPLOT | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* create data set of month and units */ data seattle; input month units; cards; 1 30 2 35 3 39 4 32 5 41 6 43 7 51 8 44 9 47 10 41 11 44 12 42 ; run; /* find the highest number of units sold for */ /* the months in SEATTLE */ data max(keep=max maxmth rename=(max=units maxmth=month)); /* declare the variables needed to hold the */ /* maximum value and the associated month */ retain max 0 maxmth 1; set seattle end=end; /* store the current maximum value */ /* and associated month */ if units > max then do; max=units; maxmth=month; end; /* write the maximum value and */ /* associated month to MAX */ If end then output max; run; /* create the Annotate data set */ data anno; length function style color $ 8 text $ 20; retain xsys '2' ysys '2' hsys '1' when 'a'; set max; /* create the observation for the star */ function='label'; color='red'; size=15; text='M'; position='B'; style='special'; x=month; y=units; output; /* create the observation for the text */ function='label'; color='green'; size=6; text=' New Record: '||left(put(units,3.)); position='3'; style='swissb'; output; run; /* define axis and symbol characteristics */ axis1 label=(height=3 color=blue angle=90 font=swissb) minor=none offset=(2) order=(25 to 55 by 10) value=(font=swissb color=green height=3) width=3; axis2 label=none minor=none value=(font=swissb color=green height=3 Tick=1 'Jan' Tick=2 'Feb' Tick=3 'Mar' Tick=4 'Apr' Tick=5 'May' Tick=6 'Jun' Tick=7 'Jul' Tick=8 'Aug' Tick=9 'Sep' Tick=10 'Oct' Tick=11 'Nov' Tick=12 'Dec') width=3; symbol interpol=join value=none width=3 color=blue; /* define the title and footnote */ title 'Seattle Sales History'; footnote j=r 'GR18N11 '; /* generate plot of units*month */ proc gplot data=seattle; plot units*month / annotate=anno frame vaxis=axis1 haxis=axis2 des='GR18N11-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR18N12 | | TITLE: REFERENCE GUIDE CHAPTER 18 OUTPUT 12 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS ANNOTATE PATTERN GMAP | | PROCS: GMAP | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: EDIT AND UNCOMMENT THE LIBNAME STATEMENT, | | libname maps 'SAS-data-library';, IF THE | | LIBREF HAS NOT BEEN DEFINED. | +-------------------------------------------------------------+*/ /* define the libref maps */ /*libname maps 'SAS-MAPS-library';*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htitle=6 htext=3; /* subset US data set */ data lower48; set maps.us; if state ne stfips('AK'); if state ne stfips('HI'); run; /* create the Annotate data set, CITIES */ data cities; length function style color $ 8 position $ 1 text $ 20; retain function 'label' xsys ysys '2' hsys '3' when 'a'; set maps.uscity(drop=state); if city='Atlanta' or city='Chicago' or city='Seattle'; /* create the observation for a star */ color='red'; size=7; text='M'; position='5'; style='special'; output; /* create the observation for a city */ color='green'; size=5; text=city; position='8'; style='swissb'; output; run; /* define the title and footnote */ footnote j=r 'GR18N12 '; title 'Distribution Center Locations'; /* define pattern characteristics */ pattern value=e repeat=49; /* generate annotated map */ proc gmap data=lower48 map=lower48; id state; choro state / discrete nolegend coutline=blue annotate=cities des='GR18N12-1'; run; quit; /*+-------------------------------------------------------------+ | S A S S A M P L E L I B R A R Y | | | | NAME: GR18N13 | | TITLE: REFERENCE GUIDE CHAPTER 18 OUTPUT 13 | | PRODUCT: GRAPH | | SYSTEM: ALL | | KEYS: GRAPHICS ANNOTATE AXIS SYMBOL GPLOT SORT | | PROCS: GPLOT SORT | | DATA: INTERNAL | | | | SUPPORT: GRAPHICS STAFF UPDATE: 03OCT89 | | REF: SAS/GRAPH REFERENCE GUIDE | | MISC: | | | +-------------------------------------------------------------+*/ /* set the graphics environment */ goptions reset=global gunit=pct border ftext=swissb htext=3 hby=0; /* create the PLOTDATA data set */ /* to be used with the GPLOT procedure */ data plotdata; length sex center $1; input center $ sex $ pop; cards; A M 23 B M 15 C M 10 D M 17 E M 5 A F 15 B F 3 C F 11 D F 4 E F 10 ; run; /* create the Annotate data set, LABEL */ data label; length function style color $ 8 sex $ 1 text $ 28; retain xsys ysys hsys '3' function 'label' color 'green' style 'swissb' size 6 x 53 y 85; /* create the observation to draw the label */ /* for the graph of females */ sex='F'; text='Number of Females Per Center'; output; /* create the observation to draw the label */ /* for the graph of males */ sex='M'; text='Number of Males Per Center'; output; run; /* sort both data sets by SEX */ proc sort data=plotdata; by sex; run; proc sort data=label; by sex; run; /* define the title and footnote */ footnote j=r 'GR18N13 '; title; /* define axis characteristics */ axis1 label=(color=green) length=5.8 in value=(color=red) width=3; ax