|
|
SASグラフ出力の横軸を入力データセットの出現順に配置する
[OS]ALL
[リリース] 6.07以降
[キーワード] graph, x, gplot, axis, order=, datastep, _null_, macro, symput
[質問]SAS/GRAPHのGPLOTプロシジャを用いて散布図を出力するとき、横軸の値をデータセット中の出現順に表示したいのですが、どのようにすればよいですか。
[回答]
GPLOTプロシジャでは、横軸の値はデフォルトでは昇順に表示されます。
data a;
input lot $ y;
cards;
112 12
105 15
131 16
100 27
;
run;
data _null_;
length order $200;
retain order ' ';
set a end=eof;
by lot notsorted;
if last.lot then
order=trim(order)||' '''||
trim(put(lot,4.))||''' ';
if eof then
call symput('order',order);
run;
proc gplot data=a;
plot y*lot/haxis=axis1;
axis1 order= &order ;
run;
quit;
|
|||||