I am creating a panel plot using SGPANEL with v 9.3 and some of the column headers are too long to fit in the column header box.
Instead of wrapping or shrinking the text, the column header names are truncated to fit in the box (in the attached example the column header "A Name That Is Too Long To Fit" is truncated to "A Name That Is Too Lo".
Is there a way to split these names to two lines or any other solution?
An additional question about the order of the panels: I have the data sorted with the variable study in a different order than it appears in the plot:
The left panel should be "A Short Name", the next panel "A Longer Name", ..., the right panel "A Name That is Too Long To Fit".
But when SAS makes the graph it sorts the study variable alphabetically and then places the panels in that order.
Is there any way to fix this?
Here is the code I am using:
proc sgpanel data=raw noautolegend;
panelby study / layout=columnlattice columns = 4
onepanel /*noborder*/ colheaderpos=top novarname;
vbox result / group=entry grouporder = data;
colaxis discreteorder = data;
run; quit;
For the second part, we added a SORTORDER option on the PANELBY statement in SAS 9.4 to handle panel sorting needs. However, for 9.3, the best way to handle this is to do the following:
1. Create a column to assign numbers to the string values in the order you want them.
2. Create a user-defined format to turn those numbers back into the string values.
3. Use this column as your PANELBY variable instead of the original string column.
Hope this helps!
Dan
Hello,
Contributor
I've the first answer for your question.
you can update your code :
COLAXIS min= -50 max= 200 valueattrs=(size=10) labelattrs=(size=10) ;
change your labelattrs size accroding to your label
Thanks .
For the second part, we added a SORTORDER option on the PANELBY statement in SAS 9.4 to handle panel sorting needs. However, for 9.3, the best way to handle this is to do the following:
1. Create a column to assign numbers to the string values in the order you want them.
2. Create a user-defined format to turn those numbers back into the string values.
3. Use this column as your PANELBY variable instead of the original string column.
Hope this helps!
Dan
Thank you so much shahparth260 and Dan for your replies to my question; I can now create the plot that I need with this information!
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.