全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1848 3
2012-03-04
不知道为啥,做出来的图形,y6和y1的图例上标识颜色总是一样,这是怎么回事啊?

有没有高手帮下忙啊,


data mydata;
do i=1 to 10;
x=i;
y1=i*2;
y2=i*3;
y3=i*4;
y4=i*5;
y5=i*6;
y6=i*100;
output;
end;
drop i;
run;


ODS GRAPHICS on/ RESET IMAGENAME = 'Final'
                 IMAGEFMT =tiff;
ODS LISTING GPATH = 'c:\MyGraphs';
goptions device=png gsfname=output gsfmode=replace xpixels=1200 ypixels=900 xmax=4 in ymax=3 in;


goption reset=global;
goptions ftext='Arial' htext=2 gunit=pct ctext=black;
title1 h=6 f='arial/bo' "This is one figure";
title2 " ";
title3 " ";
title4 " ";
title5 " ";
axis1 label=(f='arial/bo' h=5 "Price") order=(0 to 10 by 1)
      value=(f='arial/bo' h=5);
axis2 label=(a=90 f='arial/bo' h=5 "first axis") order=(0 to 100 by 10)
       value=(f='arial/bo' h=5);
axis3 label=(a=90 f='arial/bo' h=5 "second axis") order=(100 to 1000 by 100)
       value=(f='arial/bo' h=5);


LEGEND1 LABEL=(HEIGHT=1 "") value=(f='arial/bo' h=4) position=(top center outside)
        order=("y1" "y2" "y3" "y4" "y5")  FWIDTH=40
        across=3 down=2 origin=(13 84) mode=share;

LEGEND2 mode=protect LABEL=(HEIGHT=5 '') value=(f='arial/bo' h=4) position=(top center outside) origin=(23 84)pct
        order=("y6")  FWIDTH=40 mode=share;

symbol1 v=none INTERPOL=join c=blue width=5;
symbol2 v=none INTERPOL=join c=red width=5;
symbol3 v=none INTERPOL=join c=green width=5;
symbol4 v=none INTERPOL=join c=MAGENTA  width=5;
symbol5 v=none INTERPOL=join c=CRIMSON  width=5;
symbol6 v=none INTERPOL=join c=orange  width=5;


proc gplot data=mydata;
plot (y1 y2 y3 y4 y5)*x / overlay frame legend=legend1 haxis=axis1
vaxis=axis2 vref=0 cvref=black;
plot2 y6*x /overlay frame legend=legend2 vaxis=axis3;
run;
quit;


ods listing close;
ods graphics off;

二维码

扫码加我 拉你入群

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

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

全部回复
2012-3-4 22:30:59
plot2 y6*x=6 /overlay frame legend=legend2 vaxis=axis3;
二维码

扫码加我 拉你入群

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

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

2012-3-4 23:16:04
把legend1 & legend2 中的order=("y1" "y2" "y3" "y4" "y5") & order=("y6") 去掉.
二维码

扫码加我 拉你入群

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

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

2012-3-6 00:08:05
我想你的程序应该没有问题。很难理解为什么你的颜色不变化。。京剧
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群