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

I am trying to show the data points for the longitudinal data plots. 

 

proc sgplot data=test_series;
series y=glucose x=time /group=subject;
xaxis values=(0, 6, 12, 24);
run;

 

I can only generate the following plots (first plot) using the above code.

I tried 

symbol interpol=join   value=dot;   

and it is not working. 

 

The second plot showed an example of data points. I only need black dots for my plots. 

 

 

 

plots_no_dataPoints.jpgexample_plots_with_DataPoints.jpg

 

 

Any suggestions? 

Thank you so much!

1 ACCEPTED SOLUTION

Accepted Solutions
jeniffer_jacob
Fluorite | Level 6

Thank you so much for your kind reply. 

 

But markerattrs doesn't work with series statement. 

 

proc sgplot data=test_series;
series y=glucose x=time /group=subject;
xaxis values=(0, 6, 12, 24);
markerattrs=(symbol=circlefilled size=25
color=black);
run;

 

Markerattrs does work with scatter statement. But how can I connect the data points if I use scatter statement with markerattrs?

 

proc sgplot data=test_series;
scatter x=time y=glucose / filledoutlinedmarkers
markeroutlineattrs=(color=red thickness=2)
markerattrs=(symbol=circlefilled size=25
color=black);
run;

 

scatter_glucose.png

 

Any other suggestions?

Thank you so much!

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

@jeniffer_jacob wrote:

I am trying to show the data points for the longitudinal data plots. 

 

proc sgplot data=test_series;
series y=glucose x=time /group=subject;
xaxis values=(0, 6, 12, 24);
run;

 

I can only generate the following plots (first plot) using the above code.

I tried 

symbol interpol=join   value=dot;   

and it is not working. 

 

The second plot showed an example of data points. I only need black dots for my plots. 


The SYMBOL command only works on old style graphics procedures, such as PROC GPLOT. It does not work in PROC SGPLOT.

 

You can add dots for the markers on the SGPLOT by adding the MARKERS option to the SCATTER statement, along with any or all of the options MARKERATTRS= MARKERFILLATTRS= MARKEROUTLINEATTRS= as described in the documentation at https://documentation.sas.com/?docsetId=grstatproc&docsetTarget=n1jkqnmk6y6ms9n1b2vvubyzqd4a.htm&doc...

 

 

 

 

--
Paige Miller
jeniffer_jacob
Fluorite | Level 6

Thank you so much for your kind reply. 

 

But markerattrs doesn't work with series statement. 

 

proc sgplot data=test_series;
series y=glucose x=time /group=subject;
xaxis values=(0, 6, 12, 24);
markerattrs=(symbol=circlefilled size=25
color=black);
run;

 

Markerattrs does work with scatter statement. But how can I connect the data points if I use scatter statement with markerattrs?

 

proc sgplot data=test_series;
scatter x=time y=glucose / filledoutlinedmarkers
markeroutlineattrs=(color=red thickness=2)
markerattrs=(symbol=circlefilled size=25
color=black);
run;

 

scatter_glucose.png

 

Any other suggestions?

Thank you so much!

jeniffer_jacob
Fluorite | Level 6

I figured it out! Markerattrs needs markers in front of it for series statement. 

 

Thanks again for your help!

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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