Data visualization with SAS programming

dot plot with SGPLOT

Reply
Frequent Contributor
Posts: 115

dot plot with SGPLOT

Is there a way to sort by record count when using a dot plot.
It defaults to sorting by category var name.
SAS Employee
Posts: 977

Re: dot plot with SGPLOT

Elaborate on what "dot plot" you're using?...
(a 'proc gchart' scatter plot? something with 'proc sgplot'? other?)
SAS Super FREQ
Posts: 925

Re: dot plot with SGPLOT

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
Frequent Contributor
Posts: 115

Re: dot plot with SGPLOT

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.
Frequent Contributor
Posts: 115

Re: dot plot with SGPLOT

Oh. I see u are using scatter.
That worked. Thanks
Ask a Question
Discussion stats
  • 4 replies
  • 399 views
  • 0 likes
  • 3 in conversation