SAS:GTL输出流程图

准备工作:创建如图所示的数据集,命名为finalplot(text是文本框里面的内容,position文本框的方式,ord没用,x_和y_是文本框的坐标,m1和n1是箭头的起始坐标,m2和n2是箭头的终点坐标,group是对文本框做了分类,这里用来填充不同的颜色)

 

proc sort data=final;by group text;run;
proc template;
    define statgraph finalplot;
        begingraph/datacolors=(lightblue white); /*指明填充不同的颜色*/
            layout overlay /yaxisopts=(linearopts=(viewmin=0 viewmax=60) display=none)
                                            xaxisopts=(linearopts=(viewmin=0 viewmax=50) display=none)
                                            walldisplay=none;
                            textplot x=x_ y=y_ text=text /name="m"
                                                                                        contributeoffsets=none
                                                                                        position=position/*数据集中的变量,指明文本框的位置*/
                                                                                        splitpolicy=splitalways/*指明换行符是否一直生效,其他选项可能会出现部分不换行的情况*/
                                                                                        splitchar="*"/*指明换行符*/
                                                                                        splitjustify=auto/*与position结合使用,sas会自动选取对齐方式,这里实现不同的group居中和左对齐*/
                                                                                        splitchardrop=true/*是否扔掉换行符*/
                                                                                        vcenter=bbox
                                                                                        display=(fill outline)/*指明是否填充*/
                                                                                        group=group/*分组变量*/
/*                                                                                        fillattrs=graphdata1(color=lightblue transparency=0) *//*这里想实现不同组用不同的填充颜色的,但是没有成功,故采用了在上面的begingraph后添加命令*/
/*                                                                                        fillattrs=graphdata2(color=red transparency=0)*//*这里想实现不同组用不同的填充颜色的,但是没有成功,故采用了在上面的begingraph后添加命令*/
                                                                                        textattrs=(weight=bold color=black)/*字体设置*/
                                                                                        outlineattrs=(color=black);/*文本框框线颜色*/
                            vectorplot xorigin=m1 yorigin=n1 x=m2 y=n2 /xaxis=x/*箭头的始末位置变量*/
                                                                                                                    yaxis=y 
                                                                                                                    arrowdirection=out
                                                                                                                    arrowheadshape=filled/*箭头的种类*/
                                                                                                                    lineattrs=(pattern=solid thickness=1px color=black);/*箭头设置*/
/*                            drawline x1=35 y1=25 x2=35 y2=10 /xaxis=x*/
/*                                                                                                yaxis=y */
/*                                                                                                drawspace=datavalue*/
/*                                                                                                lineattrs=(pattern=solid thickness=1px color=black);*//*这段代码可实现单独再画一条线*/
            endlayout;
        endgraph;
    end;
run;

ods listing close;
ods graphics on / ANTIALIASMAX=9999 ;
ods rtf file="&&_orgOut&period.\&PgmNm..rtf"  nogfootnote nogtitle;
proc sgrender data=final template=finalplot;
run;
ods graphics off;
ods rtf close;
ods listing;
最终结果如下

  • 34
    点赞
  • 27
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值