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!

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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