如何在 gplot 图中生成 2 行
How to generate 2 line in gplot graph
在我阅读 http://support.sas.com/kb/46/723.html 的代码后,我想创建 2 行具有不同的类别,下面是我的数据:
x y 类别
7 7 1
4 6 1
1 5 1
6 4 2
3.5 3 2
0.5 1 2
但是我无法创建不同类别的两条线,下面是我的代码
/* Set the graphics environment */
goptions reset=all border cback=white htitle=12pt htext=10pt;
/* Define a title for the graph */
title1 "Include Only Select Values in the Legend";
/* Define symbol characteristics */
symbol1 interpol=spline value=dot color=vibg;
symbol2 interpol=spline value=dot color=depk;
symbol3 interpol=spline value=dot color=mob;
/* Define legend characteristics */
*legend1 order=('First' 'Third') label=none frame;
/* Define axis characteristics */
axis1 label=none;
proc gplot DATA=WORK.TEST_DATA(KEEP=x y Category);
BY Category;
plot (y y) * x / overlay legend=legend1 vaxis=axis1
FRAME;
BY Category;
run;
quit;
我的预期结果应该在一张图中有2行不同的类别,我的代码应该怎么写?请帮忙,谢谢。
尝试这样的事情:
proc sort data = sashelp.class out = class;
by SEX AGE;
run;
proc gplot DATA=class(KEEP=age height sex);
plot height * age = sex / vaxis=axis1
FRAME;
run;
quit;
在我阅读 http://support.sas.com/kb/46/723.html 的代码后,我想创建 2 行具有不同的类别,下面是我的数据:
x y 类别
7 7 1
4 6 1
1 5 1
6 4 2
3.5 3 2
0.5 1 2
但是我无法创建不同类别的两条线,下面是我的代码
/* Set the graphics environment */
goptions reset=all border cback=white htitle=12pt htext=10pt;
/* Define a title for the graph */
title1 "Include Only Select Values in the Legend";
/* Define symbol characteristics */
symbol1 interpol=spline value=dot color=vibg;
symbol2 interpol=spline value=dot color=depk;
symbol3 interpol=spline value=dot color=mob;
/* Define legend characteristics */
*legend1 order=('First' 'Third') label=none frame;
/* Define axis characteristics */
axis1 label=none;
proc gplot DATA=WORK.TEST_DATA(KEEP=x y Category);
BY Category;
plot (y y) * x / overlay legend=legend1 vaxis=axis1
FRAME;
BY Category;
run;
quit;
我的预期结果应该在一张图中有2行不同的类别,我的代码应该怎么写?请帮忙,谢谢。
尝试这样的事情:
proc sort data = sashelp.class out = class;
by SEX AGE;
run;
proc gplot DATA=class(KEEP=age height sex);
plot height * age = sex / vaxis=axis1
FRAME;
run;
quit;