全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
16891 78
2012-11-21

/*基于SAS/GRAPH绘制动画雪景图*/
/* assign the destination for current directory */

x 'cd d:\docs';
filename out 'test1.gif';
/* set the graphics environment and assign the */
/* appropriategraphics options for the animation */

goptions reset=all    device=gifanim    gsfname=out
    gsfmode=replace    iteration=0    delay=80    ftext=swissb
    cback=SkyBlue    ctext=navy    htext=1;

%let n=100;

/* number of patients = number of random numbers */
/* create data sets for the sequence of graphs   */

data a;
do i=1 to &n;
        x=3+rannor(345);
        y=pdf('PARETO',x,.5,1);
        output;
end;
run;


data b; set a;
do k=1 to &n+1-i;
        l=&n+1-k;
        output;
end;
run;

proc sort data=b; by l; run;

data c;   set b;    by l;
z=0;    w=1;    output;
z=0;    w=2;    output;
z=0;    w=3;    output;
run;


proc sort data=c; by l w; run;

data d; set c;
if i=l and w=1 then z=y*2;
if i=l and w=2 then z=y;
run;

data test;
do x=0 to 7 by .1;
        z1=pdf('PARETO',x,.5,1);
        output;
end;
run;


data test1; set test;
do l=1 to &n;
        do w=1 to 3;
        output;
        end;
end;
run;

data plot; set test1 d; run;


proc sort data=plot; by l w; run;
/*The following code sets the symbol statements for the graphs and uses */
/*proc gplot to produce the plots to be animated by GIFANIM driver */

symbol1 color=green i=join w=5 l=45;
symbol2 font=marker value=T color=Snow h=3;
axis1 order=(0 to .5 by .1) offset=(1,1) minor=(number=1) label=none ;
axis2 order=(0 to 7 by 1) offset=(1,1) minor=(number=1) label=none ;


/*VALUE=special-symbol specifies a plot symbol for the data points */
proc gplot data=plot uniform;
plot z1*x=1 z*x=2/vaxis=axis1 haxis=axis2 overlay CFRAME=SkyBlue
                                    vref=.1 to .4 by .1    lvref=2
                                    href= 1 to  6 by     1    lhref=2 nolegend ;
by l w;
run; quit;

/* end the animation */
data _null_;
file out recfm=n mod;  put '3B'x;
run;

/*disassociates the currently assigned filerefs*/
filename out clear;

test1.gif


/* 瑞雪兆丰年 */
/*
看官,请点击帖子左下角的“评分”给点鼓励吧! */

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2012-11-21 11:32:12
最近都很有娱乐精神呐!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-11-21 13:38:27
支持 能画海贼王吗
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-11-21 13:59:59
附件图片太大,可以做小一点kb,不然看不到
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-11-21 14:21:04
啥东东呢,看不到呀
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-11-21 14:39:25
有意思~~赞一个!!!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群