- %macro comment(); /*这是一种比较特殊的注释方式*/
- Picture: Draw Text
- (using template and sgrender procedure)
- Software: SAS 9.4 TS Level 1M2
- Name: justsoso
- Date: 20180308
- From: Getting Started with the Graph Template Language in SAS:
- Examples, Tips, and Techniques for Creating Custom Graphs
- History: 20180308;
- %mend;
- ods _all_ close; /*关闭所有ods destinations,避免不必要的输出,节省计算机资源*/
- /*ods listing gpath='C:\Users\Administrator\Desktop\test20180308' image_dpi=300;*/
- ods listing gpath='C:\Users\Administrator\Desktop\test20180308';
- /*打开ods listing这一destination,指定图片保存路径,★★★★★需提前建立*/
- /*ods graphics on / imagename="picture" outputfmt=pdf;*/
- /*图片名称picture,输出类型pdf*/
- ods graphics off;
- /*Draw Text*/
- proc template;
- define statgraph Fig_7_4_1;
- begingraph;
- entrytitle "Regression Fit Plot";
- layout overlay / xaxisopts=( offsetmin=.1);
- drawtext textattrs=(style=italic size=7pt)
- "Band shows 99% Confidence Limit of Mean" /
- anchor=bottomleft width=15 widthunit=percent/*文本框的宽度*/
- xspace=wallpercent yspace=wallpercent
- x=0 y=10 justify=center ;
- modelband "myclm";
- scatterplot x=height y=weight / primary=true;
- regressionplot x=height y=weight / alpha=.01 clm="myclm" ;
- drawtext textattrs=(color=gray size=40pt weight=bold)
- "PRELIMINARY"/ transparency=.75 rotate=-30 width=200
- widthunit=percent justify=center;
- endlayout;
- endgraph;
- end;
- run;
- proc sgrender data=sashelp.class template=Fig_7_4_1;
- run;
- ods _all_ close;
- /*ods html; 最好将ods destination恢复至默认的html*/