Data visualization with SAS programming

SGPLOT graph names variables orders by Q3

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 13
Accepted Solution

SGPLOT graph names variables orders by Q3

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.

 

 

 

 


Accepted Solutions
Solution
‎01-26-2016 07:51 PM
Super User
Super User
Posts: 7,695

Re: SGPLOT graph names variables orders by Q3

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


All Replies
Solution
‎01-26-2016 07:51 PM
Super User
Super User
Posts: 7,695

Re: SGPLOT graph names variables orders by Q3

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

 

SAS Super FREQ
Posts: 3,620

Re: SGPLOT graph names variables orders by Q3

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;

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 289 views
  • 0 likes
  • 3 in conversation