BookmarkSubscribeRSS Feed
Jaime
Fluorite | Level 6
Is there a way to sort by record count when using a dot plot.
It defaults to sorting by category var name.
4 REPLIES 4
GraphGuy
Meteorite | Level 14
Elaborate on what "dot plot" you're using?...
(a 'proc gchart' scatter plot? something with 'proc sgplot'? other?)
DanH_sas
SAS Super FREQ
For the SAS 9.2 release, we do not have a "sort by response" option for dot plots. However, you can work around this by presummarizing your data, sorting it by the response value, and plotting it in sgplot using a a scatter plot to simulate a dot plot by using options like the following:

proc sgplot data=sorted;
yaxis grid;
scatter x=freqcount y=category / markerattrs=(symbol=circlefilled);
run;

Let me know if this works for you.

Thanks!
Dan
Jaime
Fluorite | Level 6
I am using
proc sgplot data=Current_Pipeline_ByName;
dot Name/ response=Recs markerattrs=(symbol=circlefilled color=cxA6D96A size=12) NOSTATLABEL ;
yaxis display=(nolabel);
xaxis display=(nolabel);
run;


I did sort the data with the order i needed. But the proc sorts on its own.
Jaime
Fluorite | Level 6
Oh. I see u are using scatter.
That worked. Thanks

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

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