BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
JulieM
Obsidian | Level 7

Maybe a trivial question, but how can I make the graphs (scatterplots) generated from SGPlot to show the BY variables as the graph title and not "Variables ordered by Q3"? This came about after I used PROC Transpose to change my data from wide to long format and after which I sorted the response variable according to a categorical grouping with PROC Sort.

 

I can't find anything on this in the documentation or on the web and I'm getting desperate 😞

 

Thanks.

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Your question isn't clear to me, but at a guess:

proc sgplot ...;

  by avariable;

  title "The by variable value here is #byvar1";  /* Note you can also use #byval1 */

  scatter x=... y=...;

run;

 

http://www2.sas.com/proceedings/sugi23/Coders/p75.pdf

 

View solution in original post

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Your question isn't clear to me, but at a guess:

proc sgplot ...;

  by avariable;

  title "The by variable value here is #byvar1";  /* Note you can also use #byval1 */

  scatter x=... y=...;

run;

 

http://www2.sas.com/proceedings/sugi23/Coders/p75.pdf

 

Rick_SAS
SAS Super FREQ

Another guess: when you use PROC TRANSPOSE, the new variables are given a default label. If you don't like the label on the axes, you can use the XAXIS and YAXIS statements to change them:

 

proc sgplot;

scatter x=x y=y;

xaxis label="My X label";

yaxis label="My Y label";

run;

 

sas-innovate-white.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.

 

Early bird rate extended! Save $200 when you sign up by March 31.

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
  • 2 replies
  • 1201 views
  • 0 likes
  • 3 in conversation