Hi,
I'm experimenting with the bubble statement in sgplot to duplicate some code done in proc template. I need to strip out all axes in the plot produced by:
data test;
x=1; y=2; size=68; output;
x=2; y=2; size=49; output;
x=3; y=2; size=77; output;
x=4; y=2; size=6 ; output;
x=1; y=1; size=70; output;
x=2; y=1; size=46; output;
x=3; y=1; size=73; output;
x=4; y=1; size=10; output;
run;
title;
ods html;
proc sgplot data=test;
bubble x=x y=y size=size/datalabel=size
colormodel=(red blue green brown)
colorresponse=x
fill
transparency=.5
datalabelpos=center
datalabelattrs=(color=black);
run;
Eventually I also want to make the overall bubble sizes a bit larger and the edges fade out.
Thanks!
--Ben
ods html;
ods graphics / reset width=6in height=2in noscale;
proc sgplot data=test noborder;
bubble x=x y=y size=size/datalabel=size
colormodel=(red blue green brown)
colorresponse=x
fill bradiusmax=36
transparency=.5
datalabelpos=center
datalabelattrs=(color=black)
datalabelattrs=(size=9 weight=bold);
xaxis display=none;
There is no feature for edge fading. You can use DataSkins to get other effects.
yaxis display=none;
run;
ods html;
ods graphics / reset width=6in height=2in noscale;
proc sgplot data=test noborder;
bubble x=x y=y size=size/datalabel=size
colormodel=(red blue green brown)
colorresponse=x
fill bradiusmax=36
transparency=.5
datalabelpos=center
datalabelattrs=(color=black)
datalabelattrs=(size=9 weight=bold);
xaxis display=none;
There is no feature for edge fading. You can use DataSkins to get other effects.
yaxis display=none;
run;
Thanks, Sanjay! Is there a way to lose the gradient bar on the right side?
--Ben
To get rid of the gradient legend:
proc sgplot data=test noautolegend;
You will probably want to do this:
proc sgplot data=test nowall noborder;
xaxis display=none;
yaxis display=none;
.....
run;
Hi Sanjay,
Thanks for the link and insight. I had carefully avoided bringing up the choice of visual presentation as the client had chosen that and approved the representation. So I was stuck. But I couldn't agree more on the thoughts of when and when not to use bubble charts.
--Ben
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.