SAS中文论坛

 找回密码
 立即注册

扫一扫,访问微社区

查看: 1684|回复: 0
打印 上一主题 下一主题

瑞雪兆丰年

[复制链接]

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
楼主
 楼主| 发表于 2012-11-21 20:46:49 | 只看该作者

瑞雪兆丰年

[code:2okvr1n5]/*基于SAS/GRAPH绘制动画雪景图*/
/* assign the destination for current directory */
x 'cd c:\';
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;[/code:2okvr1n5]
转自 <!-- m --><a class="postlink" href="http://bbs.pinggu.org/thread-2137713-1-1.html">http://bbs.pinggu.org/thread-2137713-1-1.html</a><!-- m -->
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SAS中文论坛  

GMT+8, 2025-6-8 15:05 , Processed in 0.068179 second(s), 19 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表