Hi:
By default, in SAS 9.1.3, if you use ODS Graphics, it looks like you get a FILLed contour plot with a scatter overlaid on top of it. However, you CAN get a LINE contour plot with a scatter overlaid on it, by changing the DISPLAY=FILL in the graph template to DISPLAY=LINE for the CONTOURPLOTPARM statement:
[pre]
ContourPlotParm x=DENSITYX y=DENSITYY z=DENSITYCOUNT /
display=line nhint=15 name="Contour";
[/pre]
I don't see an overlay option in the PLOT statement of Proc GCONTOUR, so I'm not sure you'd be able to do what you want with PROC GPLOT/PROC GCONTOUR.
Perhaps the program below will give you an idea of what's possible with ODS Graphics in SAS 9.1.3 and will give you something to look forward to in SAS 9.2....I haven't investigated a lot, so I don't know whether the new SGPLOT/SGSCATTER will allow you to accomplish what you want (but I suspect it might).
Until then, perhaps some form of the program below will help. For more information on using Graph Templates with SAS 9.1.3, refer to this paper:
http://www2.sas.com/proceedings/sugi30/239-30.pdf
(Also, please note that this paper uses 9.1.3 specific syntax. With the new "statgraph" procedures available in SAS 9.2, changes to the graph template will probably NOT be needed.)
cynthia
[pre]
*** the program;
ods path work.tmp(update)
sashelp.tmplmst(read);
proc template;
define statgraph Stat.KDE.Graphics.ContourScatter;
dynamic _SCATTER _TITLE _DEPLABEL _DEPLABEL2;
layout Gridded;
layout overlay / padbottom=5;
entrytitle _TITLE;
endlayout;
layout lattice / rows=1 columns=1;
layout Overlay / xaxisopts=( thresholdmin=0 thresholdmax=0 )
yaxisopts=( thresholdmin=0 thresholdmax=0 ) xoffsetmin=0
xoffsetmax=0 yoffsetmin=0 yoffsetmax=0 padright=5;
ContourPlotParm x=DENSITYX y=DENSITYY z=DENSITYCOUNT /
display=line nhint=15 name="Contour";
if (_SCATTER=1)
scatterplot x=X y=Y /
markersymbol=GraphDataDefault:markersymbol
markercolor=GraphDataDefault:contrastcolor
markersize=GraphDataDefault:markersize;
endif;
EndLayout;
row2header;
GradientLegend "Contour";
endrow2header;
EndLayout;
EndLayout;
end;
run;
ods html path='.' (url=none)
file='kde_graf.html' style=analysis;
ods graphics on;
ods select contourscatter;
proc kde data=sashelp.class;
bivar age height / plots=all;
run;
ods graphics off;
ods html close;
[/pre]