Can We able to fill the Marker symbols with data values in the scatter graph like in the first image? any suggestions. Thank you.
PS: Example provided is sashelp.class dataset, there is a overlapping of data points. For our study specific graph there is no overlapping issue.
proc template;
define statgraph xx;
begingraph/BORDER=off;
layout lattice / ;
layout overlay /xaxisopts=(label=' ' linearopts =(tickvaluelist=(10 11 12 13 14 15 16 ) viewmin=10 viewmax=17 TICKVALUEFITPOLICY=THIN))
yaxisopts = (linearopts =(tickvaluelist=(50 55 60 65 70 ) viewmin=50 viewmax=70));
scatterplot x=age y=height /
markerattrs = (symbol=diamond size=20 color=maroon);
referenceline x=13;
annotate;
endlayout;
endlayout;
endgraph;
end;
run;
ods graphics on/ width= 9in height= 5.6in border=off ;
ods html;
ods listing close;
proc sgrender data=class template="xx";
run;
ods _all_ close;
ods graphics off;
Or, you can use SCATTERPLOT option DATALABELPOSITION=CENTER.
Probably, but not sure there's an automated way to separate the overlaps easily.
I would try just plotting the labels first and seeing how that looked.
Here's the steps you'd need to do:
Thank you @Reeza for your response .
Please read my comments for you Reponses.
1. Yes I will make sure of the symbol size, Mostly my data points are single digits so there will be no issue with the size.
2. There is no overlapping issue in my data points.
3. Tried Data label option however it always displaying the values (labels) outside of the symbol. I am not sure what you mean by tweaking. You expecting to create two graphs and overlap the labels with marker symbols?
Or, you can use SCATTERPLOT option DATALABELPOSITION=CENTER.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.