BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
braam
Quartz | Level 8

Can I add the frequency for each group (MAKE) in the below plot? I can generate the plot to check the distribution by MAKE, but I would like to display the exact number of observations (for each MAKE).

 

ods graphics/height=800px;
proc sgplot data=sashelp.cars;
hbar make;
yaxis display=all fitpolicy=none;
run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

Small correction:

 

ods graphics/height=800px;
proc sgplot data=sashelp.cars; 
hbar make / datalabel;
yaxis display=all fitpolicy=none;
run;

View solution in original post

4 REPLIES 4
braam
Quartz | Level 8

Sorry for the bad display of the code. The below is the same as in the main posting.

 

ods graphics/height=800px;
proc sgplot data=sashelp.cars; 
hbar make;
yaxis display=all fitpolicy=none;
run;
PeterClemmensen
Tourmaline | Level 20

Small correction:

 

ods graphics/height=800px;
proc sgplot data=sashelp.cars; 
hbar make / datalabel;
yaxis display=all fitpolicy=none;
run;
braam
Quartz | Level 8

Again, your suggestion worked well for the example I posted.

 

Then I applied it to my own dataset and SAS tells me the below warning:

WARNING: The data labels are suppressed. Use DATALABELFITPOLICY=NONE to force the labels to be
         displayed.

When I added DATALABELFITPOLICY=NONE in my code, it works well. Do you know why this option is needed only for some cases?

 

 

SAS Innovate 2025: Call for Content

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 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1806 views
  • 0 likes
  • 2 in conversation