Overlaying a line

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 19
Accepted Solution

Overlaying a line

Hi, I have two variables I'd like to plot out using a scatter plot. I'd also like to add onto that same plot a line at a 45 degree angle. What is the best way to go about doing this? Thanks!


Accepted Solutions
Solution
‎01-20-2016 11:08 AM
Grand Advisor
Posts: 9,571

Re: Overlaying a line

proc sgplot data=sashelp.class aspect=1;
 scatter x=weight y=height/group=sex;
 lineparm x=0 y=0 slope=1;
run;

View solution in original post


All Replies
Grand Advisor
Posts: 10,210

Re: Overlaying a line

This shows one way to generate the line over a scatter plot. Add a second scatter plot statement for the second variable.

http://support.sas.com/kb/49/302.html

Super Contributor
Posts: 490

Re: Overlaying a line

Solution
‎01-20-2016 11:08 AM
Grand Advisor
Posts: 9,571

Re: Overlaying a line

proc sgplot data=sashelp.class aspect=1;
 scatter x=weight y=height/group=sex;
 lineparm x=0 y=0 slope=1;
run;
☑ This topic is SOLVED.

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

Discussion stats
  • 3 replies
  • 279 views
  • 0 likes
  • 4 in conversation