FOCUS AREAS

Graphics

jitter on a discrete axis
Base SAS: ODS Graphics Procedure: SGPLOT

/* This program requires SAS 9.4 TS Level 1M1 or later */
%let gpath='.';
%let dpi=100;

proc template;
  define style styles.blueBG;
    parent = Styles.htmlblue;
    style graphbackground  from graphbackground
      "Abstract colors used in graph styles" /
      color   = cxf0f0f7;
  end;
run;

/*--Subset Heart Dataset--*/
data heart;
  set sashelp.heart(keep=deathcause cholesterol sex ageatstart 
    where=(deathcause not in ('Other', '')  
           and ageatstart > 50));
  if cholesterol ne .;
  run;

ods html close;

/*--Discrete X Axis--*/
ods listing style=styles.blueBG image_dpi=&dpi gpath=&gpath;
ods graphics / reset width=5in height=3.75in imagename='Jitter_94';
title 'Cholesterol by Death Cause';
footnote j=l h=0.9 'This graphs uses jitter on discrete X axis';
proc sgplot data=heart noautolegend;
  scatter x=deathcause y=cholesterol / jitter 
    markerattrs=graphdata1(size=9 symbol=circlefilled)
    filledoutlinedmarkers markeroutlineattrs=(thickness=0) 
    markerfillattrs=graphdata1 dataskin=sheen;
  vbox cholesterol / category=deathcause fillattrs=(transparency=0.5) nooutliers;
  xaxis display=(nolabel);
  yaxis grid;
  run;

title;
footnote;