我想以PROC SGPLOT
散点图的形式呈现数据,误差线由一条线连接,并让图例同时使用语句中的点和scatter
语句中的线series
。
以下是一些数据:
data dat;
input x y high low grp $;
cards;
1 2.50 2.90 2.00 A
2 1.90 2.35 1.45 A
3 1.75 2.25 1.25 A
1 2.10 2.50 1.70 B
2 2.00 2.40 1.60 B
3 1.80 2.20 1.40 B
;
run;
我要调整的代码:
proc sgplot data=dat;
scatter x=x y=y / yerrorupper=high yerrorlower=low group=grp
groupdisplay=cluster clusterwidth=0.1
markerattrs=(size=7 symbol=circlefilled);
series x=x y=y / group=grp groupdisplay=cluster clusterwidth=0.1;
xaxis label='Time' values=(1,2,3);
yaxis label='Response' min=0 max=3.5;
keylegend / location=inside position=topright title="Group";
run;
当前输出:
我希望图例只包含一个实例,A
并且B
符号位于图例中的行顶部,就像它在图中一样。我怎样才能做到这一点?