BookmarkSubscribeRSS Feed
xguo2
Calcite | Level 5

Does anyone know how to do left or right justified values in the table underneath plot with using Proc SGPLOT xaxistable. Currently the default is center-justified. Many thanks!

6 REPLIES 6
Jay54
Meteorite | Level 14

ValuesHAlign and ValuesJustify are available for the YAxisTable.  These are NOT available for XAxisTable.  Please see documentation.

xguo2
Calcite | Level 5

I was searching for the manual prior to posting, and do not think ValuesHAlign and ValuesJustify work for xaxistable. Please confirm if the counterpart statement available for xaxistable. Thanks

RW9
Diamond | Level 26 RW9
Diamond | Level 26

You need to try it, I have nothing here of your project to try this out on.

xguo2
Calcite | Level 5

Hi I forgot to mention that I tried both statement which were listed for YAXISTABLE, and got error message like below:

ERROR 22-322: Syntax error, expecting one of the following: ;, ATTRID, CLASS, CLASSDISPLAY, CLASSORDER, COLORGROUP, DROPONMISSING, INDENT, INDENTWEIGHT, LABEL, LABELATTRS,
              LABELPOS, LOCATION, NAME, NOLABEL, NOMISSINGCHAR, NOMISSINGCLASS, NOSTATLABEL, PAD, POSITION, SEPARATOR, STAT, STATLABEL, TEXTGROUP, TEXTGROUPID, TITLE,
              TITLEATTRS, VALUEATTRS, X, X2AXIS.
ERROR 76-322: Syntax error, statement will be ignored.

 

The syntax I used is like this:

proc sgplot data=su;
 step x=time y=survival /group=stratum name='survival' lineattrs=(thickness=2) ;

 scatter x=time y=surv /GROUP=stratum  markerattrs=(symbol=circlefilled size=2);
xaxistable atrisk /class=stratum x=tatrisk colorgroup=stratum labelpos=left  ValuesHAlign=right
                   VALUEATTRS=(size=9 weight=bold)  LABELATTRS=(size=9 weight=bold);

keylegend 'survival' /location=inside position=bottomleft across=1;

xaxis min=0 max=24 offsetmax=0.05 values=(0 to 24 by 6) valueshint label='Time'
                                 labelattrs=( size=9pt weight=bold) valueattrs=( size=9pt weight=bold);
yaxis offsetmin=0.02 min=0 offsetmax=0.02 max=1.0
                     labelattrs=( size=9pt weight=bold ) valueattrs=( size=9pt weight=bold);
run;

 

I also tried to convert variable 'tatrisk' to character type to see the alignment can be set, however xaxistable function only accept numeric variable.

 

Any other suggestions- Thank you!

Jay54
Meteorite | Level 14

In the code you have attached, you are using XAXISTABLE, which does NOT support ValuesHAlign.  Please attach a full working program (with some dummy date) so we can see what is going on.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 2440 views
  • 2 likes
  • 3 in conversation