楼主: mmume
1538 3

[程序分享] 基于SAS9.3的经济学人风格图(含代码) [推广有奖]

  • 1关注
  • 1粉丝

初中生

19%

还不是VIP/贵宾

-

威望
0
论坛币
278 个
通用积分
0
学术水平
17 点
热心指数
17 点
信用等级
17 点
经验
231 点
帖子
10
精华
0
在线时间
9 小时
注册时间
2010-7-10
最后登录
2016-6-3

相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币

SAS作图



说明:这是闲着没事做的经济学人风格系列图之一,分享一个给大家,如有转载请注明出处,以下源代码只能SAS9.3及以上才能使用!

/*---------------------------------------------------------*\

Name: Foreigntradecooperation.sas

Title:China's overseas contracted projects

Author::WenYi  Email:dear&mmu.me

From:http://www.douban.com/group/sasfinance/

Created:2012/06/26 SAS9.3

\*---------------------------------------------------------*/

ods listing close;

ods html file='mbar.html' path='.' ;

ods graphics/reset width=600px height=480px imagename='Foreigntradecooperation' imagefmt=png;

title j=left color=black height=2 font=arialblack " China's overseas contracted projects";

title2 j=left color=black font=arial 'The value of newly-signed contracts';

footnote justify=left color=cx7e96c2 'Source:Ministry Of Commerce,PRC' justify=right color=cx7e96c2 'Graph by WenYi' ;

data squares;

infile datalines dlm='#';

length fillcolor $ 9

display $ 9

function $ 12

linecolor $ 9;

input function $ x1 y1 width height fillcolor linecolor display;

datalines;

rectangle # 0 # 113 # 5#10 # cxd5272b # cxd5272b #all

;

run;

data work.contract;

input t yymmn6. dd tb;

cards;

201008        143.8        128.2539683

201009        70.6        29.06764168

201010        141.4        13.30128205

201011        141.8        122.9559748

201012        241        22.39715592

201101        103.9        -25.78571429

201102        73.7        56.80851064

201103        131.9        68.67007673

201104        127.1        25.59288538

201105        123.2        39.84108967

201106        102.1        7.586933614

201107        95.8        71.07142857

201108        84        -41.58553547

201109        89.5        26.77053824

201110        114.5        -19.02404526

201111        95.5        -32.651622

201112        282.1        17.05394191

201201        93.3        -10.20211742

201202        51.5        -30.12211669

201203        152.8        15.84533738

201204        55.8        -56.09756098

201205        85.2        -30.84415584

;

run;

proc sgplot data=work.contract sganno=squares;

vbar t/response=dd barwidth=0.3 fill fillattrs=(color=cx349cdf) legendlabel='Contracts,billions of dollars';

vline t /response=tb markers y2axis limits=both lineattrs=(color=cx86351c thickness=3) markerattrs=(color=cx86351c size=3) legendlabel='%change year on year';

format t mmyy5.;

xaxis display=(nolabel);

yaxis values=(0 to 300 by 50) display=(nolabel) valueattrs=(color=cx349cdf weight=bold);

y2axis values=(-100 to 200 by 50) display=(nolabel) grid minor valueattrs=(color=cx86351c weight=bold);

keylegend / noborder down=1 location=outside position=topleft valueattrs=(color=black size=11 style=italic weight=normal);

run;

quit;

ods html close;

ods listing;














二维码

扫码加我 拉你入群

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

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

关键词:经济学人风格图 经济学人 SAS9 经济学 COOPERATION 风格

已有 3 人评分学术水平 热心指数 信用等级 收起 理由
夏之鹭江 + 1 + 1 + 1 精彩帖子
playmore + 1 + 1 + 1 精彩帖子
hopewell + 5 + 5 + 5 精彩帖子

总评分: 学术水平 + 7  热心指数 + 7  信用等级 + 7   查看全部评分

本帖被以下文库推荐

沙发
lee780988 发表于 2014-3-20 11:18:58 |只看作者 |坛友微信交流群
学习

使用道具

藤椅
Alexmingzhi 在职认证  发表于 2014-3-21 13:59:38 |只看作者 |坛友微信交流群
很厉害的样子
sense and sensibility....

使用道具

板凳
xiao苏苏 发表于 2014-3-24 10:09:24 |只看作者 |坛友微信交流群
谢谢分享~~~~~~~~~~~~~

使用道具

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

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

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

GMT+8, 2024-4-30 23:40