楼主: yunnandlg
2384 0

[学习分享] 转载 Proc Gplot:运用Gplot作图 [推广有奖]

版主

但问耕耘,莫问收获

院士

0%

还不是VIP/贵宾

-

威望
0
论坛币
251627 个
通用积分
578.6351
学术水平
1667 点
热心指数
1686 点
信用等级
1650 点
经验
173251 点
帖子
1939
精华
0
在线时间
2582 小时
注册时间
2010-8-28
最后登录
2024-4-26

楼主
yunnandlg 在职认证  学生认证  发表于 2016-7-12 13:17:48 |只看作者 |坛友微信交流群|倒序 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
Proc Gplot:运用Gplot作图         (2008-11-17 09:58:45)[url=]转载[/url]

标签: gplot proc sas graph 教育分类: Proc过程

Proc Gplot:运用Gplot作图

原文地址:http://www2.sas.com/proceedings/sugi31/239-31.pdf

转载出处:http://blog.sina.com.cn/s/blog_5d3b177c0100b68a.html

Data如下,为一个时间序列数据。这个数据是自己编的,只是为了方便测试程序。

data t112;

input nh_tot fg_tot year;

cards;

90 90 1970

120 100 1971

170 110 1972

240 120 1973

330 130 1974

440 140 1975

560 150 1976

690 160 1977

850 170 1978

1090 180 1979

1290 190 1980

1590 200 1981

;

run;


11 对曲线进行标注:

data my_labels;

   retain xsys ysys '2' function 'label'

          position '1' style "'Arial/bo'"

          color 'blue' cborder 'blue';

   set t112 end=last;

   if last then do;

      text=' FEDERAL GOVERNMENT '; x=year; y=fg_tot; output;

      text=' TOTAL '             ; x=year; y=nh_tot; output;

   end;

run;

goptions ftext='Arial' htext=2 gunit=pct ctext=green csymbol=blue;

options validvarname=upcase;

symbol1 f=marker v='C' i=join h=1.25;

symbol2 f=marker v='U' i=join h=1.25;

axis1 label=(angle=90 rotate=0 "AMOUNT (IN BILLIONS)") minor=(n=3);

axis2 order=(1970 to 1982 by 2) minor=(n=4) offset=(2,2);

title h=4 f='Arial/bo' "NATIONAL HEALTH CARE EXPENDITURES: 1970-1982";

footnote j=right "Source: Health-United States-2003";

proc gplot data=t112;

   plot (nh_tot fg_tot)*year/overlay vaxis=axis1 haxis=axis2 caxis=blue annotate=my_labels;

   format nh_tot comma.;

run;

Gplot:运用Gplot作图" title="Proc Gplot:运用Gplot作图" action-data="http%3A%2F%2Fs12.sinaimg.cn%2Fbmiddle%2F5d3b177cg5bd8ff5d666b" action-type="show-slide" style="border-width: 0px; border-style: initial; list-style: none;">

12 生成一个GIF图像文件

options validvarname=upcase;

goptions device=gif gsfname=gout xpixels=1024 ypixels=768

         ftext='Arial' htext=2 gunit=pct ctext=green csymbol=blue;

symbol1 f=marker v='C' i=join h=1.25;

symbol2 f=marker v='U' i=join h=1.25;

axis1 label=(angle=90 rotate=0 "AMOUNT (IN BILLIONS)") minor=(n=3);

axis2 order=(1970 to 1982 by 2) minor=(n=4) offset=(2,2);

legend1 label=none value=(j=left "TOTAL" j=left "FEDERAL GOVT")

        mode=protect position=(top inside left)

        cborder=blue cshadow=blue

        across=1 shape=symbol(6,1.25);

title h=4 f='Arial/bo' "NATIONAL HEALTH CARE EXPENDITURES: 1970-2000";

footnote j=right "Source: Health-United States-2003";

filename gout 'c:\healthexp.gif';

proc gplot data=t112;

   plot (nh_tot fg_tot)*year/overlay vaxis=axis1 haxis=axis2 caxis=blue legend=legend1;

   format exp comma.;

run;

13 noframe选项,使得图像能自动调整适合的大小

options validvarname=upcase;

goptions ftext='Arial' htext=2 gunit=pct ctext=green csymbol=blue;

symbol1 v=dot i=join h=2.5 l=1;

symbol2 v=dot i=join h=2.5 l=3;

axis1 label=(angle=90 rotate=0 "AMOUNT (IN BILLIONS)") minor=(n=3);

axis2 order=(1970 to 1982 by 5) minor=(n=4) offset=(2,2);

legend1 label=none value=(j=left "TOTAL" j=left "FEDERAL GOVT")

        mode=protect position=(top inside left)

        cborder=blue cshadow=blue

        across=1 shape=line(10);

title h=4 f='Arial/bo' "NATIONAL HEALTH CARE EXPENDITURES: 1970-1982";

footnote j=right "Source: Health-United States-2003";

proc gplot data=t112;

   plot (nh_tot fg_tot)*year/overlay vaxis=axis1 haxis=axis2 caxis=blue legend=legend1 noframe;

   format nh_tot comma.;

run;

Gplot:运用Gplot作图" title="Proc Gplot:运用Gplot作图" action-data="http%3A%2F%2Fs12.sinaimg.cn%2Fbmiddle%2F5d3b177cg5bd900b83ddb" action-type="show-slide" style="border-width: 0px; border-style: initial; list-style: none;">



二维码

扫码加我 拉你入群

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

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

关键词:gplot plot GPL ROC Expenditures 标签 程序

Cause morning rolls around and it's another day of sun.
清晨不久就会来到,又是阳光明媚的一天。
您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-27 01:13