【发布时间】:2014-07-03 16:26:29
【问题描述】:
我正在尝试修改 SAS proc sgplot 中的直方图,以使 bin 不会以图形方式居中于中点。相反,我希望它们从 0 到 5、5 到 10 等。按照目前的图表方式,我在 0 处得到了这个奇怪的“半条”——它的厚度不合适,看起来很奇怪。
我不依赖于使用 sgplot,如果我仍然可以获得所需的叠加直方图,我可以使用单变量或 proc 模板。这是我的数据:
data have;
input x y;
cards;
1 .
5 .
6 .
20 .
13 .
4 .
2 .
2 .
7 .
4 .
17 .
33 .
2 .
. 2
. 15
. 4
. 10
. 35
. 20
. 6
. 14
;
run;
proc sgplot data=have;
histogram x / fillattrs=graphdata1 name='s' legendlabel='x'
transparency=0.5 binstart=0 binwidth=5;
histogram y / fillattrs=graphdata2 name='d' legendlabel='y'
transparency=0.5 binstart=0 binwidth=5;
keylegend 's' 'd' / location=inside position=topright across=1;
xaxis display=(nolabel) label='label' min=0 max=40;
run;
谢谢。
皮尔
【问题讨论】: