%let gpath=C:\;
ods html close;
%let w=4in;
%let h=2.5in;
%let dpi=200;
ods listing gpath="&gpath" image_dpi=&dpi;
/*--X Axis Tick Default--*/
ods graphics / reset width=&w height=&h imagename='Axis_Ticks_Default';
title 'Height by Name';
proc sgplot data=sashelp.class noborder;
vbar name / response=height stat=mean nostatlabel dataskin=pressed;
xaxis display=(nolabel noticks);
yaxis display=(noline noticks) grid;
run;
/*--X Axis Tick Stack--*/
ods graphics / reset width=&w height=&h imagename='Axis_Ticks_Stack';
title 'Height by Name';
proc sgplot data=sashelp.class noborder;
vbar name / response=height stat=mean nostatlabel fillattrs=graphdata1 dataskin=pressed;
xaxis display=(nolabel noticks) fitpolicy=stackedAlways;
yaxis display=(noline noticks) grid;
run;
/*--X Axis Tick Diagonal2--*/
ods graphics / reset width=&w height=&h imagename='Axis_Ticks_Diagonal2';
title 'Height by Name';
proc sgplot data=sashelp.class noborder;
vbar name / response=height stat=mean nostatlabel fillattrs=graphdata2 dataskin=pressed;
xaxis display=(nolabel noticks) fitpolicy=rotate valuesrotate=diagonal2;
yaxis display=(noline noticks) grid;
run;
/*--X Axis Tick Vertical--*/
ods graphics / reset width=&w height=&h imagename='Axis_Ticks_Vertical';
title 'Height by Name';
proc sgplot data=sashelp.class noborder;
vbar name / response=height stat=mean nostatlabel fillattrs=graphdata3 dataskin=pressed;
xaxis display=(nolabel noline noticks) fitpolicy=rotate valuesrotate=vertical;
yaxis display=(noline noticks) grid;
run;
/*--Compute mean height--*/
proc means data=sashelp.class;
var height;
output out=mean
mean=mean;
run;
/*--Save mean (4.1 format) height in macro--*/
data _null_;
set mean;
meanchar=put(mean, 4.1);
call symput("Mean", meanchar);
run;
/*--Compute deviation from mean of height--*/
data class;
set sashelp.class;
Deviation=height-&mean;
run;
/*--Bar Baseline bottom--*/
ods graphics / reset width=&w height=&h imagename='Bar_Baseline_1';
title 'Height by Name';
proc sgplot data=sashelp.class noborder;
vbar name / response=height stat=mean nostatlabel fillattrs=graphdata4 dataskin=pressed
displaybaseline=auto;
xaxis display=(nolabel noline noticks) fitpolicy=rotate valuesrotate=vertical;
yaxis display=(noline noticks) grid;
run;
/*--Bar Baseline middle with "Inbetween" tick position--*/
ods graphics / reset width=&w height=&h imagename='Bar_Baseline_2';
title "Deviation of Height from mean (&mean.in)";
proc sgplot data=class noborder;
vbar name / response=deviation stat=mean nostatlabel fillattrs=graphdata5 dataskin=pressed
displaybaseline=auto;
xaxis display=(nolabel noline noticks) grid
fitpolicy=rotate valuesrotate=vertical tickstyle=inbetween;
yaxis display=(noline noticks) grid;
run;
title;