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
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
  • 2843 views
  • 0 likes
  • 3 in conversation