%let gpath='C:\Work\Blogs\Graphically Speaking\2012\Post_25Apr_2012_BarLog'; %let dpi=100; ods html close; proc means data=sashelp.cars mean clm; class type; var horsepower; output out=carsmean mean=mean lclm=lower uclm=upper; run; proc print data=carsmean;run; data carsmean2; set carsmean(where=(_type_=1)); drop _type_ _freq_; zero=0.01; run; proc print;run; ods listing gpath=&gpath image_dpi=&dpi; /*--Needle plot with Log Y axis--*/ ods graphics / reset width=5in height=3in imagename='NeedleLog'; title 'Log of Mean Horsepower by Type'; proc sgplot data=carsmean2; needle x=type y=mean / lineattrs=(color=lightblue thickness=20); yaxis type=log min=10 max=1000 offsetmin=0 label='Mean (Log)'; run; /*--HighLow plot with Log Y axis--*/ ods graphics / reset noscale width=5in height=3in imagename='BarLog'; title 'Log of Mean Horsepower by Type'; proc sgplot data=carsmean2; format mean 4.0; highlow x=type low=zero high=mean / type=bar highlabel=mean; yaxis type=log max=1000 offsetmin=0 label='Log of Mean' grid; xaxis display=(nolabel); run;