Can anyone tell me which options I have to change to make these bars bigger and more space between them? Just looks too on top of each other as it is currently. I tried barwidth and clusterwidth and it's not producing what I want.
proc sgpanel data=aedata;
panelby sev_abbr;
hbar SOC/response=count group=aesevn groupdisplay=cluster datalabel=labelvar clusterwidth=0.85 barwidth=0.85;
colaxis label="Number of Events";
rowaxislabel="System Organ Class";
run;
The Clusterwidth and Barwidth are ratio values and the default is .8 so your change to .85 is not significant. Reduce Barwidth to get space between bars, at .5 the width between bars should be the width of the bar
Some other ideas: increase the available height of the graph area. ODS Graphics / height=6in;
would set the display height to 6 inches. Set a height bigger and then play with the cluster and bar width parameters.
If you want lots of control you can use another plot like VECTOR but that means doing a lot more work to control the x,y pairs for base and height for the vector bars and really wants a numeric axis, so you would need to work more with the axis and Vector doesn't have any "cluster". So you get to spend a lot of time working on the exact placement of bars. One thing though is you can have a variable represent how wide each vector bar should be, so you have a different tool to emphasize / de-emphasize each bar
Okay, I will try a height of 6+ inches. Here is some fake data.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.