I am trying create the KM plot, my Y axis lable is very long, How can I split and fit in to the lable in the graph also want to make it bold. This is the code I am using for Plot options
goptions reset = (global all) device = sasemf ftext = "courier new unicode ms/unicode" ftitle = "courier new unicode ms/unicode" xmax = 9.0in ymax = 3.8in gunit = pt; axis1 value = (h=10pt rotate=0 angle=0) order = (0 to 225 by 25) label = (f = "courier new unicode ms/unicode" h=8pt j=c "contious days of requiremnt" j=c" " j=c" ") major = (h=1pt w=1) minor = (n=4) ; axis2 value = (h=10pt) order = (0 to 1 by 0.1) offset = (.1in) label = (f = "courier new unicode ms/unicode" h=8pt a=90 /*j=c " " j=c " "*/ j=c "This is very long label I want to split and arrange horizontal") major = (h=1pt w=1) minor = (n=4) ; legend1 shape = symbol(40,6) mode = reserve position = (bottom center outside) value = (h=8.5) label = (h=9 " " position=left j=l) space = 1 across = 1 down = 1 ; /*symbol1 i=steplj c=black w=2 h=2 l=1;*/ symbol2 i=steplj c=black w=2 h=2 l=1;
the output on Y axis is like below in graph.
Sas Log giving the warning about the enough space;
WARNING: Not enough space for the label "Failure". Variable name is used.
NOTE: There were 78 observations read from the data set WORK.lg.
NOTE: There were 59 observations read from the data set WORK.lg.
NOTE: PROCEDURE GPLOT used (Total process time):
real time 0.12 seconds
cpu time 0.06 seconds
thanks in advance.
Thank you for the response. Its adhoc work , so I was sticking to the existed code of using annote . I tried the link but I am not able to get the ans. can you please provide an example if possible. Thanks
In the axis2 for order value make it (0 to 0.5(uptill where you want the value to display) by 0.1). This should help you.
That just reduced the y axis length to 0.5 instead of 1 ( which is bigger the length than 0.5 option). I tried to increase by 0.05 but that did not help.
Is this what you are looking for? The Split= option uses the specified character to split the text.
label = (f = "courier new unicode ms/unicode" h=8pt a=90 j=c split='/' "This is very long /label I want to split /and arrange horizontal")
With the older SAS Graph Axis statement fonts are sometimes a bit tricky. If a font has a BOLD version it may be addressed by adding the Bold option in the Font settings
Possibly:
label = (f = "courier new unicode ms/unicode bold" h=8pt a=90 j=c split='/' "This is very long /label I want to split /and arrange horizontal")
or possibly
label = (f = "courier new unicode ms/unicode/bold" h=8pt a=90 j=c split='/' "This is very long /label I want to split /and arrange horizontal")
Unicode is way newer than my experience with SAS/Graph and the various statements like Axis so I am not sure how well it fits in with the old syntax. Some fonts had specific font names like "Arial Bold" (not sure it that was legit but the font name was required to use the bold versions of some.
I also seem to recall dealing with some issues about font families versus actual font names that cropped up.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.