%let gpath=C:\;
ods html close;
%let w=4in;
%let h=3in;
%let dpi=200;
ods listing style=htmlblue gpath="&gpath" image_dpi=&dpi;
/*--Create column for all types--*/
data cars;
set sashelp.cars(where=(type='Sedan'));
AllType='All';
run;
/*--Default Jitter--*/
ods graphics / reset attrpriority=color width=&w height=&h imagename='Turnip';
title 'Distribution of Mileage for all cars';
proc sgplot data=cars noautolegend noborder;
scatter x=alltype y=mpg_city / jitter markerattrs=(size=9);
xaxis display=(novalues noticks) label='Number of Cars with each Mileage';
yaxis display=(nolabel noline noticks) grid;
run;
/*--Uniform Jitter--*/
ods graphics / reset attrpriority=color width=&w height=&h imagename='Turnip_Uniform';
title 'Distribution of Mileage for all cars';
proc sgplot data=cars noautolegend noborder;
scatter x=alltype y=mpg_city / jitter=uniform markerattrs=(size=9);
xaxis display=(novalues noticks) label='Number of Cars with each Mileage';
yaxis display=(nolabel noline noticks) grid;
run;
/*--Uniform Jitter Filled JitterWidth--*/
ods graphics / reset attrpriority=color width=&w height=&h imagename='Turnip_Uniform_Filled';
title 'Distribution of Mileage for all cars';
proc sgplot data=cars noautolegend noborder;
scatter x=alltype y=mpg_city / jitter=uniform jitterwidth=1
markerattrs=(symbol=circlefilled size=7 color=red);
xaxis display=(novalues noticks) label='Number of Cars with each Mileage';
yaxis display=(nolabel noline noticks) grid;
run;
/*--Uniform Jitter Filled JitterWidth Border--*/
ods graphics / reset attrpriority=color width=&w height=&h imagename='Turnip_Uniform_Border';
title 'Distribution of Mileage for all cars';
proc sgplot data=cars noautolegend noborder;
scatter x=alltype y=mpg_city / jitter=uniform jitterwidth=1
markerattrs=(symbol=circlefilled size=7 color=red)
filledoutlinedmarkers
markerfillattrs=(color=red) markeroutlineattrs=(color=white);
xaxis display=(novalues noticks) label='Number of Cars with each Mileage';
yaxis display=(nolabel noline noticks) grid;
run;
/*--Uniform Jitter Filled JitterWidth Border by type--*/
ods graphics / reset attrpriority=color width=&w height=2in imagename='Turnip_Uniform_Type_US';
title 'Distribution of Mileage for US Cars';
proc sgplot data=sashelp.cars(where=(origin eq 'USA' and type ne 'Truck')) noautolegend noborder;
scatter x=type y=mpg_city / jitter=uniform jitterwidth=1
markerattrs=(symbol=circlefilled size=7 color=green);
xaxis display=(nolabel noticks);
yaxis display=(nolabel noline noticks) grid;
run;