/***************************************************************************************************************** SAS file name: Scatter_Plot.sas File location: _________________________________________________________________________________________________________________ Purpose: To demonstrate how to draw a simple scatter plot with PROC SGPLOT in SAS. Author: Peter Clemmensen Creation Date: 15/07/2017 This program supports the example page "SAS Scatter Plot in PROC SGPLOT" on SASnrd.com *****************************************************************************************************************/ /* Make sure that ods graphics is on and that the HTML output desitnation is on */ ods graphics on / reset; ods html style=htmlblue; /* Draw Simple Scatter Plot with PROC SGPLOT */ title "Simple Scatter Plot With PROC SGPLOT"; proc sgplot data=sashelp.iris; scatter x=sepallength y=sepalwidth / group=species; run; title; /* Add some modifications to make the plot easier to analyze */ ods graphics on / attrpriority=none; title "Scatter Plot With Modifications With PROC SGPLOT"; proc sgplot data=sashelp.iris noautolegend; styleattrs datasymbols=(circlefilled squarefilled starfilled); scatter x=sepallength y=sepalwidth / group=species; keylegend / location=inside position=NE across=1; run; title;