BookmarkSubscribeRSS Feed
d0816
Quartz | Level 8

I am using this code to graph a histogram, but the barlabels are overlapping eachother. Like in excel , is there a way to change orientation of the barlabels? I have been trying to look for the ans for the past 1 hour. I found orient and rotate option but don't seem to work here.

Thanks.

 

proc univariate data = have noprint;

histogram variable1 / 

vscale=percent

barlabel = percent

midpoints = -50 to 50 by 2;

INSET N MEAN (8.2) MEDIAN (8.2) STD = 'Std. Dev' (8.3)/ POSITION = ne;

label variable1= "";

run;

 

4 REPLIES 4
ballardw
Super User

Many midpoints doesn't leave much space. Consider if you actually need that many or if the spacing (the 2) needs to be that small.

 

Increase the graph size using ODS graphics options is one possibility but may not be feasible depending on the actual range of values.

 

Another might be to use Proc SGPLOT which has many more options with histogram. Or summarizing the data and using a VBAR or HBAR type display.

Reeza
Super User
Unfortunately modifying the default graphics is harder, its significantly easier if you're using PROC SGPLOT.
d0816
Quartz | Level 8
Thanks for the reply.



How do you change orientation with proc SGPLOT?


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

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1455 views
  • 2 likes
  • 4 in conversation