Hi there,
I was trying to create a forest plot.
However the leading space was removed in the figure.
Anyone can help? Thanks!
Here is a small part of my figure:
The first column is aligned at left, but it does have blank in my dataset like
here is the first part of my GTL code to define the first column:
proc template;
DEFINE STATGRAPH Forest;
begingraph;
layout lattice /columns=4 columnweights=(0.27 0.15 0.15 0.43);
/*First column*/
layout overlay / walldisplay=none xaxisopts=(display=none)
yaxisopts=(reverse=true display=none);
axistable y=obs value=txt / display=(values);
endlayout;
I also tried to use "A0"x to replace the space with non blank space, however the value was trancated at some place.
Hello,
A number of SAS graph statements automatically clear leading and trailing blanks. You would have better luck adding another variable with the number of indents you would want and use the INDENT and INDENTWEIGHT options to get what you are looking for.
Also, shameless plug to my forest plot making macro:
It looks like the INDENT option with INDENTWEIGHT may accomplish what you want. The Indentweight would be an expression to calculate a multiple of the indent amount for each value.
If that doesn't work you could try replacing the spaces with NULL characters, ASCII-255.
Many SAS procedures will display text justified to the left ignoring the more traditional "blank" space such as the space or tab character. The null character sometimes gets around that. You want to very carefully comment that is what you are doing as the code will not be obvious to anyone when you use this character.
Hello,
A number of SAS graph statements automatically clear leading and trailing blanks. You would have better luck adding another variable with the number of indents you would want and use the INDENT and INDENTWEIGHT options to get what you are looking for.
Also, shameless plug to my forest plot making macro:
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.