- 阅读权限
- 255
- 威望
- 0 级
- 论坛币
- 4501 个
- 通用积分
- 76.6084
- 学术水平
- 171 点
- 热心指数
- 204 点
- 信用等级
- 133 点
- 经验
- 24581 点
- 帖子
- 584
- 精华
- 1
- 在线时间
- 1862 小时
- 注册时间
- 2008-5-25
- 最后登录
- 2023-9-20
|
- %macro comment(); /*这是一种比较特殊的注释方式*/
- Picture: Reference Line and Drop Line (using template and sgrender procedure)
- Software: SAS 9.4 TS Level 1M2
- Name: justsoso
- Date: 20180229
- From: Getting Started with the Graph Template Language in SAS:
- Examples, Tips, and Techniques for Creating Custom Graphs
- History: 20180229;
- %mend;
- data GTL_GS_HeatmapParm;
- drop pi val;
- pi=constant('Pi');
- do x=1 to 20;
- do y=1 to 10;
- value=sin(x*pi/10) + cos(y*pi/10);
- val=ranuni(2);
- group=ifc(val < 0.5, 'M', 'F');
- output;
- end;
- end;
- run;
- /*proc print data=GTL_GS_HeatmapParm; run;*/
- ods _all_ close; /*关闭所有ods destinations,避免不必要的输出,节省计算机资源*/
- /*ods listing gpath='C:\Users\Administrator\Desktop\test20180229' image_dpi=100;*/
- ods listing gpath='C:\Users\Administrator\Desktop\test20180229';
- /*打开ods listing这一destination,指定图片保存路径,★★★★★需提前建立*/
- /*ods graphics on / imagename="picture" outputfmt=pdf width=4in height=2.5in;*/
- /*ods graphics on / imagename="picture" outputfmt=pdf;*/
- /*图片名称picture,输出类型pdf*/
- ods graphics off;
- /*Reference Line and Drop Line*/
- proc template;
- define statgraph Fig_4_6_2;
- begingraph;
- entrytitle "Basic Heat Map";
- layout overlay / xaxisopts=(display=(ticks tickvalues))
- yaxisopts=(display=(ticks tickvalues));
- heatmapparm x=x y=y colorresponse=value / name='a';
- continuouslegend 'a';
- endlayout;
- endgraph;
- end;
- run;
- proc sgrender data=GTL_GS_HeatmapParm template=Fig_4_6_2;
- run;
- ods _all_ close;
- /*ods html; 最好将ods destination恢复至默认的html*/
复制代码
|
|