BookmarkSubscribeRSS Feed
L_L
Calcite | Level 5 L_L
Calcite | Level 5

Dear all,

I'm using this code

PROC SGSCATTER  DATA=input;

MATRIX alpha beta / GROUP=var_group

                    START=TOPLEFT ;

RUN;

I would like to add axis legend: how could I do?

Thanks in advance for any help

Kind regards

5 REPLIES 5
Rick_SAS
SAS Super FREQ

I'm not sure what you mean by an axis legend. Do you mean that you want the variables names (or labels) to be displayed next to the axes?  If so, I don't think you can get that with the MATRIX statement, but you can use the PLOT or COMPARE statements. For example,  the following code arranges two plots in a panel and labels all axes:

PROC SGSCATTER  DATA=sashelp.class;

compare x=(height age) y=weight / GROUP=sex;

RUN;

DanH_sas
SAS Super FREQ

In SAS 9.2, maintenance 3, we added support for axis legends in the Graph Template Language (GTL); but the SG procedures do not currently support them. Also, be aware that an axis legend can be associated with only one axis; therefore, you would need multiple legends for multiple axes. I'm still not sure about your use case. Is it a scatter plot matrix with long axis values?

L_L
Calcite | Level 5 L_L
Calcite | Level 5

Dear Dan

Yes I'll need multiple legends for multiple axes.

Ok now I'm sure that's not possible.

Thank you in advance 

DanH_sas
SAS Super FREQ

Multple axis legends are supported. I was just making the point that you can only have one axis per legend, as opposed to a DISCRETELEGEND, where you can have multiple plots in the same legend. Do you have 9.2m3?

L_L
Calcite | Level 5 L_L
Calcite | Level 5

I'm using SAS ENTRIPRISE GUIDE 4.3  and SAS 9.2

sas-innovate-wordmark-2025-midnight.png

Register Today!

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.


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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1755 views
  • 6 likes
  • 3 in conversation