楼主: mmuokay
6180 15

[原创博文] 经济学人风格图bySAS 9.3 gtl [推广有奖]

  • 1关注
  • 7粉丝

大专生

83%

还不是VIP/贵宾

-

威望
0
论坛币
14051 个
通用积分
0
学术水平
21 点
热心指数
21 点
信用等级
21 点
经验
1647 点
帖子
32
精华
0
在线时间
94 小时
注册时间
2014-6-5
最后登录
2023-8-22

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币

As an Economist reader, I really appreciate their graphics. As a SAS user, I want to recreate Economist’s graph and use it in my work. So I envisage making some Economist’s Graphs’ Template, and this one is the second one. You can find the other plots here : http://blog.data2biz.org/?cat=4

Any suggestions, critics, helps will be appreciated.

The original graph is in :[url]http://www.economist.com/blogs/graphicdetail/2014/05/daily-chart-18[/url]

/*  ======  Reproduce Graph Using SAS  ============== *\

Note : The data we use is fictitious.

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

Name: Eband.sas

Title:Number employed in the developing word by income group

Author:WenYi&WW

Blog: http://blog.data2biz.org/

Source:http://www.economist.com/blogs/g ... 4/05/daily-chart-18

Created:2014/06/03 SAS9.3

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

/*读取数据文件*/

data fivestocks;

input date $ 1-10 a1 b2 c3 d4 f5;

cards;

2006/12/31 0.75 1.35 1.61 1.9 1.95

2007/12/31 0.72 1.3 1.65 1.92 1.99

2008/12/31 0.73 1.31 1.68 1.93 2.12

2009/12/31 0.7 1.35 1.72 2 2.23

2010/12/31 0.65 1.31 1.66 2.11 2.35

2011/12/31 0.6 1.28 1.64 2.21 2.43

2012/12/31 0.56 1.12 1.6 2.23 2.56

2013/12/31 0.46 0.94 1.56 2.3 2.68

2014/12/31 0.4 0.87 1.52 2.36 2.81

2015/12/31 0.32 0.73 1.45 2.48 2.95

;

run;

/*设置模板*/

proc template;

define statgraph fivestocks; /*定义主题名称*/

begingraph/border=false;     /*无边框*/

entrytitle halign=left "Number employed in the developing word by income group" / TEXTATTRS=(COLOR=black FAMILY='微软雅黑' size=18 STYLE=normal WEIGHT=bold) ;                   /*设置标题*/

entrytitle halign=left "Bn(2005$ at PPP*,per day)" / TEXTATTRS=(color=black family='微软雅黑' size=12 style=italic weight=normal) ;/*设置副标题*/

layout overlay/WALLDISPLAY=none xaxisopts=( display=(line ticks tickvalues) type=discrete tickvalueattrs = (FAMILY='Arial' COLOR=black)) yaxisopts=(griddisplay=on GRIDATTRS=(THICKNESS=2.5) display=NONE DISPLAYSECONDARY=(TICKVALUES) TICKVALUEATTRS=(COLOR=black FAMILY='微软雅黑' size=10 STYLE=normal WEIGHT=normal)) ;

bandplot x=date limitupper=f5 limitlower=0/FILLATTRS = (COLOR=cx00a1ce) DISPLAY=all OUTLINEATTRS=(color=cx191612 PATTERN=1 THICKNESS=3) DATATRANSPARENCY=0;                     /*画图*/

bandplot x=date limitupper=d4 limitlower=0/FILLATTRS = (COLOR=cx00485d) DISPLAY=all OUTLINEATTRS=(color=cxf8fbfc PATTERN=1 THICKNESS=3) DATATRANSPARENCY=0;

bandplot x=date limitupper=c3 limitlower=0/FILLATTRS = (COLOR=cx5a8098) DISPLAY=all OUTLINEATTRS=(color=cxf8fbfc PATTERN=1 THICKNESS=3) DATATRANSPARENCY=0;

bandplot x=date limitupper=b2 limitlower=0/FILLATTRS = (COLOR=cxeea083) DISPLAY=all OUTLINEATTRS=(color=cxf8fbfc PATTERN=1 THICKNESS=3) DATATRANSPARENCY=0;

bandplot x=date limitupper=a1 limitlower=0/FILLATTRS = (COLOR=cxe9744f) DISPLAY=all OUTLINEATTRS=(color=cxf8fbfc PATTERN=1 THICKNESS=3) DATATRANSPARENCY=0;

drawrectangle x=81 y=5 width=100 height=400 /anchor=bottomleft display=(fill) fillattrs=(color=gray) transparency=0.75 widthunit=pixel heightunit=pixel ;                      /*画半透明矩形*/

drawrectangle x=-6 y=105 width=39 height=55/anchor=bottomleft display=(fill) fillattrs=(color=cxe11b17) widthunit=pixel heightunit=pixel ;

                              /*画红色矩形标志*/

entry halign=right "Forecast" / valign=bottom PAD=(bottom=375px right=20px ) TEXTATTRS=(COLOR=black FAMILY='Arial' size=16 STYLE=italic WEIGHT=normal);/*文字*/

entry halign=right "Extremely poor" /valign=bottom pad=(bottom=40px right=270) TEXTATTRS=(COLOR=cxffffff FAMILY='微软雅黑' size=12 STYLE=normal WEIGHT=bold);

entry halign=right "(less than $1.25)" /valign=bottom pad=(bottom=25px right=270) TEXTATTRS=(COLOR=cxffffff FAMILY='微软雅黑' size=12 STYLE=italic WEIGHT=bold);

entry halign=right "Moderately poor" /valign=bottom pad=(bottom=120px right=270) TEXTATTRS=(COLOR=cxffffff FAMILY='微软雅黑' size=12 STYLE=normal WEIGHT=bold);

entry halign=right "($1.25-$2)" /valign=bottom pad=(bottom=105px right=270) TEXTATTRS=(COLOR=cxffffff FAMILY='微软雅黑' size=12 STYLE=italic WEIGHT=bold);

entry halign=right "Near poor" /valign=bottom pad=(bottom=185px right=270) TEXTATTRS=(COLOR=cxffffff FAMILY='微软雅黑' size=12 STYLE=normal WEIGHT=bold);

entry halign=right "($2-$4)" /valign=bottom pad=(bottom=170px right=270) TEXTATTRS=(COLOR=cxffffff FAMILY='微软雅黑' size=12 STYLE=italic WEIGHT=bold);

entry halign=right "Developing middle class" /valign=bottom pad=(bottom=230px right=270) TEXTATTRS=(COLOR=cxffffff FAMILY='微软雅黑' size=12 STYLE=normal WEIGHT=bold);

entry halign=right "($4-$13)" /valign=bottom pad=(bottom=215px right=270) TEXTATTRS=(COLOR=cxffffff FAMILY='微软雅黑' size=12 STYLE=italic WEIGHT=bold);

entry halign=right "Developed middle class and above " /valign=bottom pad=(bottom=345px right=270) TEXTATTRS=(COLOR=black FAMILY='微软雅黑' size=12 STYLE=normal WEIGHT=bold);

entry halign=right "(above $13)" /valign=bottom pad=(bottom=330px right=270) TEXTATTRS=(COLOR=black FAMILY='微软雅黑' size=12 STYLE=italic WEIGHT=bold);

drawline x1=56 y1=92 x2=60 y2=92 /x1space=wallpercent y1space=wallpercent x2space=wallpercent y2space=wallpercent lineattrs=(color=black THICKNESS=1) layer=front transparency=0.8;      /*画线*/

drawline x1=60 y1=92 x2=60 y2=78 /x1space=wallpercent y1space=wallpercent x2space=wallpercent y2space=wallpercent lineattrs=(color=black THICKNESS=1) layer=front transparency=0.8;

drawoval x=59.4 y=77.5 width=0.5 height=0.85 /ANCHOR=center display=all fillattrs=(color=black) outlineattrs=(color=black) transparency=0.25;/*画点*/

endlayout;

entryfootnote halign=left TEXTATTRS=( family='Verdana' size=8 style=normal) "blog.data2biz.org" halign=right TEXTATTRS=( family='Arial' size=8 style=italic) "Graph by WenYi&WW" ;      /*设置脚注*/

endgraph;

end;

run;


ods graphics / width=1190px height=860px border=off;/*设置图形*/

ods listing;

proc sgrender data=fivestocks template=fivestocks;/*引用数据和模板画图*/

run;




二维码

扫码加我 拉你入群

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

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

关键词:经济学人风格图 经济学人 经济学 Transparency middle class 经济学人 sas 可视化

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

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

本帖被以下文库推荐

要论坛币加 wx mediabeta
沙发
lookslike 发表于 2014-6-10 17:49:05 |只看作者 |坛友微信交流群
起立赞礼十分钟...................................


貌似这边一段代码搞完,那边可能文章都写完了。

使用道具

藤椅
mmuokay 发表于 2014-6-18 14:54:02 |只看作者 |坛友微信交流群
lookslike 发表于 2014-6-10 17:49
起立赞礼十分钟...................................
哈哈 是的 谢过

使用道具

板凳
eflucy 发表于 2014-6-23 10:27:58 |只看作者 |坛友微信交流群
赞美,收藏一下。

使用道具

报纸
playmore 发表于 2014-6-23 15:20:50 |只看作者 |坛友微信交流群
大哥,将来你出本书吧,我一定买
另外你英文不错,直接出英文的,发给SAS Publishing

使用道具

地板
nonewman 发表于 2014-6-23 17:21:55 |只看作者 |坛友微信交流群
Very well.

使用道具

7
ilovekate 发表于 2014-6-24 11:11:09 |只看作者 |坛友微信交流群
超牛的,酷毙了

使用道具

8
mmuokay 发表于 2014-6-27 12:36:22 |只看作者 |坛友微信交流群
playmore 发表于 2014-6-23 15:20
大哥,将来你出本书吧,我一定买
另外你英文不错,直接出英文的,发给SAS Publishing
过奖啦

使用道具

9
mmuokay 发表于 2014-6-27 12:37:12 |只看作者 |坛友微信交流群
ilovekate 发表于 2014-6-24 11:11
超牛的,酷毙了
有什么好图可以分享出来,应该所有图都能用SAS做出来

使用道具

10
mmuokay 发表于 2014-6-27 12:37:50 |只看作者 |坛友微信交流群
nonewman 发表于 2014-6-23 17:21
Very well.
哈哈 tanks

使用道具

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

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

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

GMT+8, 2024-4-26 18:41