FOCUS AREAS

Graphics

Weight by Height
Base SAS: ODS Graphics Procedure: SGPLOT

%let gpath='.';
%let dpi=100;

ods html close;
ods listing gpath=&gpath image_dpi=&dpi;

data class;
  set sashelp.class;
  if name='Philip' then weight=250;
run;

/* circle scatter plot's broken axis so it is more evident */
data Circle;
  infile datalines dlm='#';
  length widthunit $ 5 heightunit $ 5 linecolor $ 3;
  input function $ x1 y1 width widthunit $ height heightunit $ linecolor;
datalines;
oval # 12 # 72 # 110 # pixel # 110 # pixel # red
;
run;

/*--Scatter with Axis Break--*/
ods listing style=htmlblue;
ods graphics / reset attrpriority=none noborder width=5in height=3.75in imagename='Break_Axis';
title 'Weight by Height'; 
footnote j=l 'Axis Break';
proc sgplot data=class nowall noborder sganno=Circle;
  styleattrs axisbreak=bracket axisextent=data;
  scatter x=height y=weight / group=sex markerattrs=(size=12);
  yaxis ranges=(40-145 215-260) values=(40 to 260 by 20);
  keylegend / location=inside position=topleft;
  run;
  
title;
footnote;