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

Hello All,

I'm trying to connect points by using sgplot but it doesn't work. The option connect exists only with vbox statement and not with scatter statement. You find attached the first figure (but points are not connected. In fact every ID has its assessment in every visit and I'm trying to connect every four points which are assessments of each ID). I need also to connect the three points in the second figure . Is there any solution ?  

1 ACCEPTED SOLUTION

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

Without any code or test data, this is just theory.  But you have the points you want to draw lines between (these would be your scatter points), but isolate the ones you want and set them into other variables, then have a line plot which plots those points.  E.g

proc sgplot...;
  scatter x=x y=y;
  series x=new_varx y=new_vary;
run;

new vars are the ones holding the datapoints of interest.

 

For plenty of examples look here:

https://blogs.sas.com/content/graphicallyspeaking/

View solution in original post

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

Without any code or test data, this is just theory.  But you have the points you want to draw lines between (these would be your scatter points), but isolate the ones you want and set them into other variables, then have a line plot which plots those points.  E.g

proc sgplot...;
  scatter x=x y=y;
  series x=new_varx y=new_vary;
run;

new vars are the ones holding the datapoints of interest.

 

For plenty of examples look here:

https://blogs.sas.com/content/graphicallyspeaking/

oussema
Obsidian | Level 7

Thank you, but making new variables for each id is not needed. We can use the 'group' option is 'series' statement and it will solve the problem. 

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
  • 11407 views
  • 1 like
  • 2 in conversation