- %macro comment(); /*这是一种比较特殊的注释方式*/
- Picture: Time Axis Features
- (using template and sgrender procedure)
- Software: SAS 9.4 TS Level 1M2
- Name: justsoso
- Date: 20180305
- From: Getting Started with the Graph Template Language in SAS:
- Examples, Tips, and Techniques for Creating Custom Graphs
- History: 20180305;
- %mend;
- ods _all_ close; /*关闭所有ods destinations,避免不必要的输出,节省计算机资源*/
- /*ods listing gpath='C:\Users\Administrator\Desktop\test20180305' image_dpi=300;*/
- ods listing gpath='C:\Users\Administrator\Desktop\test20180305';
- /*打开ods listing这一destination,指定图片保存路径,★★★★★需提前建立*/
- /*ods graphics on / imagename="picture" outputfmt=pdf;*/
- /*图片名称picture,输出类型pdf*/
- ods graphics off;
- /*Time Axis Features*/
- proc template;
- define statgraph Fig_6_2_5;
- begingraph;
- entrytitle 'Monthly Stock Prices by Company';
- layout overlay / xaxisopts=( display=(ticks tickvalues)
- timeopts=(interval=semimonth minorticks=true))
- y2axisopts=(label='Price' griddisplay=on);
- highlowplot x=date high=high low=low / close=close
- yaxis=y2 lineattrs=graphdata2(thickness=3) ;
- endlayout;
- endgraph;
- end;
- run;
- ods listing style=htmlblue;
- proc sgrender template=Fig_6_2_5
- data=sashelp.stocks(where=(date > '01jan2004'd));
- where stock eq 'IBM';
- run;
- ods _all_ close;
- /*ods html; 最好将ods destination恢复至默认的html*/


雷达卡
京公网安备 11010802022788号







