Yesterday, I published an article on Axis values display, where I mentioned the desire expressed by many users to get x-axis tick values in Hotel text orienttion. The name comes from the way many hotel signs are displayed as shown on the right. Such arrangement of text can also be very useful for many Asian languages.
There is no direct support for displaying this text in SGPLOT or GTL using some option. So, I brought up the topic during lunch, and Lingxiao made a great suggestion - We could use the axis values splitting feature to get such arrangement of the x-axis tick values.
If you recall, we can use the FitPolicy=SplitAlways, and this means the value will be split on every occurrence of the split character, which is a space by default. So, if we can add spaces between each character of the category values and use this FitPolicy, we should get x-axis tick values displayed as hotel text.
Here is the code for modifying the names and a view of the data. First, I find the longest string for name (code not shown below), then I used the prxchange function to replace each character by the same character plus a space.
length newname $&maxlen;
newname = prxchange('s/(.)/$1 /', -1, name);
Now, we can use this new variable as the category and set FitPolicy=SplitAlways to get Hotel text as shown below right. This method is very scaleable and can be applied to any use case. Some details in the code are trimmed to fit. See linked program below for full details.
SGPLOT code: hoteltext