%let gpath='.';
%let dpi=200;
ods html close;
ods listing gpath=&gpath image_dpi=&dpi;
/*--Subset data--*/
data cars;
set sashelp.cars(where=(type in ('Sedan', 'Sports', 'SUV') and origin='Asia'));
grp='A';
run;
/*--Box Scatter Jitter--*/
ods graphics / reset width=5in height=3in imagename='Scatter_Box_1';
title 'Mileage by Type for Asian Cars';
proc sgplot data=cars noautolegend;
scatter x=type y=mpg_city / jitter;
vbox mpg_city / category=type nooutliers nofill;
xaxis display=(nolabel);
run;
/*--Box Scatter Offset--*/
ods graphics / reset width=5in height=3in imagename='Scatter_Box_2';
title 'Mileage by Type for Asian Cars';
proc sgplot data=cars noautolegend;
scatter x=type y=mpg_city / jitter jitterwidth=0.5;
vbox mpg_city / category=type discreteoffset=0.4 boxwidth=0.2 nooutliers nofill;
xaxis display=(nolabel);
run;
/*--Box Scatter Offset Band--*/
%let dpi=200;
ods listing gpath=&gpath image_dpi=&dpi;
ods graphics / reset width=5in height=3in imagename='Scatter_Box_3';
title 'Mileage by Type for Asian Cars';
proc sgplot data=cars noautolegend noborder;
styleattrs wallcolor=cxf0f0f0;
scatter x=type y=mpg_city / jitter jitterwidth=0.5 discreteoffset=-0.2;
vbox mpg_city / category=type discreteoffset=0.2 boxwidth=0.2 nooutliers nofill;
xaxistable type / location=inside nolabel pad=10;
xaxis display=none colorbands=even colorbandsattrs=(transparency=0.5);
yaxis display=(noline noticks) grid gridattrs=(color=white);
run;