带有goups和子组的SAS 9.4条形图

时间:2018-03-23 13:23:43

标签: sas

我想制作一个包含组和子组的条形图。 到目前为止,我得到了一张像这样的条形图 enter image description here

代码如下:

proc sgpanel data=transp_4;
panelby time / layout=columnlattice onepanel
colheaderpos=bottom rows=2 novarname noborder;
vbar type / group=grupp_text response=col1 stat=sum group=time   
nostatlabel;
colaxis display=(nolabel);
rowaxis grid;
run;

但我希望这些酒吧彼此相邻而不会被困住。 有任何想法吗? 谢谢, 桑德拉

1 个答案:

答案 0 :(得分:2)

使用groupdisplay=cluster选项将其从堆叠更改为分组。

proc sgpanel data=transp_4;
    panelby time / layout=columnlattice onepanel
        colheaderpos=bottom rows=2 novarname noborder;
    vbar type / group=grupp_text response=col1 stat=sum group=time   
        nostatlabel
        groupdisplay=cluster;
    colaxis display=(nolabel);
    rowaxis grid;
run;