BookmarkSubscribeRSS Feed
anle2079
Calcite | Level 5

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!

1 REPLY 1
ballardw
Super User

@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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1117 views
  • 0 likes
  • 2 in conversation