I produce 2 plots, one is a line contour plot produced with gcontour of a density computed from kde and the second a scatter plot of the original data produced with gplot. Does anyone know how the line contour plot can be overlayed on the scatter plot. ODS appears to be able to overlay
a scatter plot on a filled contour plot but this is not what I want.
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:
ContourPlotParm x=DENSITYX y=DENSITYY z=DENSITYCOUNT / display=line nhint=15 name="Contour";
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.)
*** the program;
ods path work.tmp(update)
It looks like the NHINTS and NLEVELS options control the suggested number of contour levels and the actual number of contour levels. For more help with Graph Templates, you might consider contacting Tech Support, as they know or can find out what or how the syntax worked between SAS 9.1.3 and SAS 9.2.