SAS绘制双坐标图
绘制 坐标 SAS
2023-06-13 09:17:27 时间
/**** 生成变量风险趋势的数据 ***/
data trend;
input Bin Prop BAD_RATE;
format Prop percent8.2;
format BAD_RATE percent8.2;
datalines;
1 0.1361 0.0443
2 0.2015 0.1030
3 0.3347 0.1567
4 0.2359 0.2187
5 0.0918 0.3139
;
run;
/*** 绘图 ***/
goptions hsize=6 vsize=4; /* 设置图形大小 */
axis1 label=("Prop") minor=none; /* left */
axis2 label=("BAD_RATE") minor=none; /* right */
axis3 label=("Bin") ; /* bottom */
legend1 position=(top outside) across=1; /* 设置图例的位置、排列方式 */
legend2 position=(top outside) across=1;
symbol1 c=black value=circle H=1.2; /* 设置标记的颜色、形状、大小 */
proc gbarline data=trend;
bar Bin/discrete sumvar=Prop raxis=axis1 maxis=axis3 legend=legend1;
plot /sumvar=BAD_RATE axis=axis2 legend=legend2;
title "双坐标图";
run;
goptions reset=all;
绘图如下: