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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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