怎么用PROC SGPLOT改进你的作图

SAS一些PROC步可以产生带有统计意义的图表， 通常情况下，我们对这些统一模板下出来的图不是很满意。
data trans;
input temp @@;
cards;
…..
;
run;

proc univariate data=Trans ;
histogram Temp / normal(percents=20 40 60 80 midpercents)
endpoints = 360 to 620 by 1;
inset n mean std / pos = ne format = 6.3;
output   out=ex n=n1 min=min2 max=max3 std=std4 mean=mean5;
run;

data trans;
input temp @@;
cards;

;

run;

ods select  Bins ;
ods output bins=bins;
proc univariate data=Trans;
histogram Temp / normal(percents=20 40 60 80 midpercents)
endpoints = 360 to 620 by 1;
inset n mean std / pos = ne format = 6.3;
output out=ex n=n1 min=min2 max=max3 mean=mean4 std=std5;
run;
data _null_;
set ex;
call symput(‘n’,n1);
call symput(‘min’,min2);
call symput(‘max’,max3);

meanx=put(mean4,8.2) ;
call symput(‘mean’,meanx);

stdx=put(std5,8.3);
call symput(‘std’,stdx);

mxnum6=round((max3-min2)/5,1);

call symput(‘mxnum’, mxnum6);
/*%let mean=%substr(&meanx.,1, %eval(%index(&meanx.,.)+2));*/
/*%let  std=%substr(&stdx., 1, %eval(%index(&stdx.,.)+3));*/
run;

proc sgplot data=bins  NOAUTOLEGEND;
yaxis label=’Percent (%) ‘ values=(0 to 2 by 0.2);
xaxis label=’Var’ values=(&min. to &max. by &mxnum.);
scatter y=obsPercent x=  MinPoint  / MARKERATTRS=(SYMBOL=asterisk color=red);
SERIES   y=estPercent x=  MinPoint / MARKERATTRS=(color=blue) ;
inset (“N”=”&n.”  “均值”=”&mean.”    “标准差”=”&std.”)
/ POSITION = TOPRIGHT BORDER;
Title;
run;
quit;