Hi ,
I'm plotting a graph using SGPLOT like below, and I'm getting the good graph with all the clients groups.
Now I want to see along with my individual client performance, I'd like to see the total performance in the same plot.
Please let me know which option should I use to get this result.
PROC SGPLOT DATA = DATA;
SCATTER Y = PERCENT X = CLIENT/ GROUP = PULL_TYPE GROUPORDER = DESCENDING MARKERATTRS = (SYMBOL = TRIANGLEFILLED);
RUN;
Hi,
You can put another graph over the top of the previous one:
PROC SGPLOT DATA = DATA;
SCATTER Y = PERCENT X = CLIENT/ GROUP = PULL_TYPE GROUPORDER = DESCENDING MARKERATTRS = (SYMBOL = TRIANGLEFILLED);
scatter y=xxx x=yyy / ...;
RUN;
You may also like to have a look at this blog, which has hundreds of examples for sgplot/template:
Here is a way using a needle plot to create a summary bar at the end.
data class;
set sashelp.class (where=(sex eq 'M')) end=_last_;
retain _sum_ 0;
_sum_=_sum_+weight;
output;
if (_last_) then do;
name="Total";
weight=.;
total=_sum_;
output;
end;
run;
proc sgplot data=class;
scatter x=name y=weight;
needle x=name y=total / y2axis lineattrs=(thickness=20);
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.