sas gtl 怎么调fieldset legend 位置的位置

sas宏作图(template模板应用)
& &这是我自己宏作图的一个程序,记在这里。
&都是从templates那本书上翻下来的。lattice作图之前要对data数据集做准备,sas没有自动的功能。另外我不知道怎么调整整个lattice的legend大小,也没找到……所以我只能把border去掉……这个容我再想想……;还有一个问题是怎么调整cellheader让它的标题居中呢?试了一下没找到方法T_T……
select count(distinct cate)&
from doi_cate_year1;
select distinct cate ,name
into :cate1-:%sysfunc(catt(cate,&n))
from doi_cate_year1;
%put &cate1 &cate2;
%do i=1 %to &n;
select name
into :name&i
from doi_cate_year1
where cate="&&cate&i";
%put &name1;
%do i=1 %to %sysevalf(&n/4,ceil);
%let j1=%eval_r((&i-1)*4+1);
%let j2=%eval_r((&i-1)*4+2);
%let j3=%eval_r((&i-1)*4+3);
%let j4=%eval_r((&i-1)*4+4);
set doi_cate_year1;
if cate eq &&cate&j1 or cate eq
&&cate&j2&
or cate eq &&cate&j3 or cate eq
&&cate&j4;
if cate=&&cate&j1 then &
cate1= &&cate&j1 ;
m_store1=m_
m_sale1=m_
else if cate=&&cate&j2
cate2= &&cate&j2 ;
m_store2=m_
m_sale2=m_
else if cate=&&cate&j3
cate3= &&cate&j3;
m_store3=m_
m_sale3=m_
else if cate=&&cate&j4
cate4= &&cate&j4;
m_store4=m_
m_sale4=m_
keep cate1-cate4 name1-name4 year1-year4 m_store1-m_store4
m_sale1-m_sale4;
define statgraph store_
& entrytitle "不同款式的存销量随时间变化图";
& layout lattice /columns=2 rows=2;
&entry halign=center
"&&name&j1"/textattrs=(weight=bold style=italic)
& & layout overlay/
xaxisopts=(display=(tickvalues label)label="年份"
labelattrs=(weight=bold) griddisplay=on)&
& yaxisopts=(display=(tickvalues
label)label="库存/销售" labelattrs=(weight=bold));
seriesplot x=year1
y=m_store1/lineattrs=GraphData1;*/name="store";
seriesplot x=year1
y=m_sale1/lineattrs=GraphData2;*/name="sale";
*discretelegend "store" "sale";
"&&name&j2"/textattrs=(weight=bold style=italic);
& & layout overlay/
xaxisopts=(display=(tickvalues label)label="年份"
labelattrs=(weight=bold) griddisplay=on)&
& yaxisopts=(display=(tickvalues
label)label="库存/销售" labelattrs=(weight=bold));
seriesplot x=year2
y=m_store2/lineattrs=GraphData1;*/name="store";
seriesplot x=year2
y=m_sale2/lineattrs=GraphData2;*/name="sale";
*discretelegend "store" "sale";
"&&name&j3"/textattrs=(weight=bold style=italic);
& & layout overlay/
xaxisopts=(display=(tickvalues label)label="年份"
labelattrs=(weight=bold) griddisplay=on)&
& yaxisopts=(display=(tickvalues
label)label="库存/销售" labelattrs=(weight=bold));
seriesplot x=year3
y=m_store3/lineattrs=GraphData1;*/name="store";
seriesplot x=year3
y=m_sale3/lineattrs=GraphData2;*/name="sale";
*discretelegend "store" "sale";
"&&name&j4"/textattrs=(weight=bold style=italic);
layout overlay/ xaxisopts=(display=(tickvalues
label)label="年份" labelattrs=(weight=bold)
griddisplay=on)&
& yaxisopts=(display=(tickvalues
label)label="库存/销售" labelattrs=(weight=bold));
seriesplot x=year4 y=m_store4/lineattrs=GraphData1
name="store" legendlabel="库存";
seriesplot x=year4 y=m_sale4/lineattrs=GraphData2 name="sale"
legendlabel="销售";
&sidebar/align=
discretelegend "store" "sale"/border=off pad=(left=3px
right=3px);*/location=outside halign=right valign=
ods listing style=
proc sgrender data=use template=store_
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。苹果/安卓/wp
积分 124, 距离下一级还需 21 积分
权限: 自定义头衔
道具: 彩虹炫, 涂鸦板, 雷达卡, 热点灯, 金钱卡, 显身卡下一级可获得
道具: 匿名卡
购买后可立即获得
权限: 隐身
道具: 金钱卡, 彩虹炫, 雷达卡, 热点灯, 涂鸦板
开心签到天数: 25 天连续签到: 1 天[LV.4]偶尔看看III
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 : Any suggestions, critics, helps will be appreciated.The original graph is in :[/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&WWBlog: Source:Created: SAS9.3 \*---------------------------------------------------------*/ /*读取数据文件*/ input date $ 1-10 a1 b2 c3 d4 f5; 0.75 1.35 1.61 1.9 1.95 0.72 1.3 1.65 1.92 1.99 0.73 1.31 1.68 1.93 2.12 0.7 1.35 1.72 2 2.23 0.65 1.31 1.66 2.11 2.35 0.6 1.28 1.64 2.21 2.43 0.56 1.12 1.6 2.23 2.56 0.46 0.94 1.56 2.3 2.68 0.4 0.87 1.52 2.36 2.81 0.32 0.73 1.45 2.48 2.95;/*设置模板*/ define
/*定义主题名称*/ begingraph/border=& &&&/*无边框*/ 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=& && && && && && && & /*画半透明矩形*/ drawrectangle x=-6 y=105 width=39 height=55/anchor=bottomleft display=(fill) fillattrs=(color=cxe11b17) widthunit=pixel heightunit=& && && && && && && && && && &/*画红色矩形标志*/ 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;/*画点*/
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& ;& && &/*设置脚注*/
ods graphics / width=1190px height=860px border=/*设置图形*/proc sgrender data=fivestocks template=/*引用数据和模板画图*/
支持楼主:、
购买后,论坛将把您花费的资金全部奖励给楼主,以表示您对TA发好贴的支持
载入中......
总评分:&学术水平 + 5&
热心指数 + 5&
信用等级 + 5&
本帖被以下文库推荐
& |主题: 144, 订阅: 56
起立赞礼十分钟...................................
貌似这边一段代码搞完,那边可能文章都写完了。
lookslike 发表于
起立赞礼十分钟...................................哈哈 是的 谢过
赞美,收藏一下。
大哥,将来你出本书吧,我一定买
另外你英文不错,直接出英文的,发给SAS Publishing
Very well.
超牛的,酷毙了
playmore 发表于
大哥,将来你出本书吧,我一定买
另外你英文不错,直接出英文的,发给SAS Publishing过奖啦
ilovekate 发表于
超牛的,酷毙了有什么好图可以分享出来,应该所有图都能用SAS做出来
nonewman 发表于
Very well.哈哈 tanks
初级学术勋章
初级学术勋章
初级热心勋章
初级热心勋章
中级热心勋章
中级热心勋章
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
如有投资本站或合作意向,请联系(010-);
邮箱:service@pinggu.org
投诉或不良信息处理:(010-)
论坛法律顾问:王进律师【图文】SAS知识 (1)_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
SAS知识 (1)
大小:3.29MB
登录百度文库,专享文档复制特权,财富值每天免费拿!
你可能喜欢SAS绘图系统及期刊常见统计图形SAS实现_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
SAS绘图系统及期刊常见统计图形SAS实现
&&1.SAS绘图体系的介绍 ,重点介绍SAS新一代的绘图工具ODS Graph System.
2. 期刊常见统计图形的SAS实现,包括图形大小,样式,类型(直方,纸条,箱线,散点,折线,森林图等及其衍生图形)。
阅读已结束,下载文档到电脑
想免费下载本文?
定制HR最喜欢的简历
下载文档到电脑,方便使用
还剩70页未读,继续阅读
定制HR最喜欢的简历
你可能喜欢

我要回帖

更多关于 echart legend位置 的文章

 

随机推荐