Data normal; do X = -2.5 to 2.5 by .1; do Y = -2.5 to 2.5 by .1; fxy = exp( -.5*(X*X + Y*Y + .8*X*Y)); if abs(X-round(2*X)/2)<.001 or abs(Y-round(2*Y)/2)<.001 then clr = "green"; else clr="red"; output; end; end; proc means data=normal nway; var fxy; class X; output out=Xmarg mean=mx; proc means data=normal nway; var fxy; class Y; output out=Ymarg mean = my; data all ; set normal Xmarg Ymarg; shapevar = "Prism "; output; hold=Y; Y=2.6; fxy= 2*mx;shapevar = "balloon"; output; X=2.6; Y=hold; fxy = 2*my;shapevar = "balloon"; output; proc g3d data=all; scatter X*Y=fxy/shape=shapevar color=clr; run;