Hi all,
I am wondering how to create a paneled bar graph which has labels by variable for each graph. To explain more, if you're creating paneled vertical bar graphs of 'cat1' by 'codetype', how do you make each panel have a label for unique code types (i.e. 'codetype=1'), instead of just having the frequency of cat1 labels on the yaxis?
Thank you in advance!
@anle2079 wrote:
Hi all,
I am wondering how to create a paneled bar graph which has labels by variable for each graph. To explain more, if you're creating paneled vertical bar graphs of 'cat1' by 'codetype', how do you make each panel have a label for unique code types (i.e. 'codetype=1'), instead of just having the frequency of cat1 labels on the yaxis?
Thank you in advance!
Never hurts to show the code that you have attempted.
By default Sgpanel will place the value of the Panelby variable above the graph.
You should have the SASHELP.Cars data set to test the following code which shows the Make=<name> at the top of each panel.
proc sgpanel data=sashelp.cars; where make in ('Acura' 'BMW' 'Chevrolet'); panelby make /columns=1; vbar cylinders; run;
The data is subset to just use few makes.
Since you are discussing appearance of a picture it is appropriate to include a image of what you want.
Otherwise we may be here for weeks trying to agree on verbiage to describe a picture. 1000 words an all that.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.