BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
kmorrowvt
Obsidian | Level 7

I'm using PROC SGPLOT and trying to determine if it is possible to split AND rotate the xaxis values. I see you can do one or the other utilizing FITPOLICY/SPLITCHAR/VALUESROTATE , but I'd like to do both. It was possible to do in PROC GCHART
axis2 minor=none  offset=(0.3 in, 0.3 in)  value=(font="Myriad Web Pro" h=10pt a=90 t=1 "Followed Up" t=2 "Post-Discharge" j=c "ROP Treatment"):

Rotated and Split.png

Is there a way to recreate this in PROC SGPLOT?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
data have;
set sashelp.heart(obs=100);
length _sex $ 80;
if sex='Male' then _sex='Followed Up';
else _sex='Post-Discharge'||'0A'x||'ROPTreatment';
run;

proc sgplot data=have;
vbox weight/category=_sex;
xaxis fitpolicy=rotatealways valuesrotate=vertical ;
run;

Ksharp_0-1738288273396.png

 

View solution in original post

4 REPLIES 4
quickbluefish
Barite | Level 11
Is the x-axis discrete? As in, not showing a continuous or time series sort of value?
kmorrowvt
Obsidian | Level 7

Yes, it is discrete.

Ksharp
Super User
data have;
set sashelp.heart(obs=100);
length _sex $ 80;
if sex='Male' then _sex='Followed Up';
else _sex='Post-Discharge'||'0A'x||'ROPTreatment';
run;

proc sgplot data=have;
vbox weight/category=_sex;
xaxis fitpolicy=rotatealways valuesrotate=vertical ;
run;

Ksharp_0-1738288273396.png

 

kmorrowvt
Obsidian | Level 7
This is perfect, thank you.

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
  • 4 replies
  • 968 views
  • 3 likes
  • 3 in conversation