BookmarkSubscribeRSS Feed
wbkrebs
Fluorite | Level 6

I have a bivariate dataset that I want to display as a bivariate histogram in 3D.  No problem there; I can use PROC KDE to bin the data, and then pass the output to a graphics template through PROC SGRENDER.

 

My problem is that I want to highlight the histogram value for a particular set of co-ordinates.  For a 2D plot, I could do this with an annotate dataset (or, there are various kludges with PROC SGPLOT).  Can I do this for a 3D plot?

 

One possible angle is that I could position a suitable marker in annotate, using the figure dimensions as the drawspace.  I'm not particularly keen about that, because I would have the translate the co-ordinates of my featured point into graph positions.  Since the bivariate histogram is shown in an orthographic (I think...) projection, I expect that would lead to some time-consuming geometry.

 

Can anybody suggest an example where such a thing has been done? Alternatively, does the ANNOTATE facility support any three-dimensional functionality when the DRAWSPACE is set to DATA?  Any advice would be gratefully appreciated.

 

Kind regards,
Barney Krebs

 

2 REPLIES 2
BrunoMueller
SAS Super FREQ

Looking at the doc for the Controlling the Drawing Space , there is no mentioning of a Z axis, so I guess this is not possible.

 

Provide an example how it should look like might help to find some creative ideas.

Ksharp
Super User

I have checked the DOC ,there is no such option you could get job done.

You could connect to sas support to ask them to add this feature in PROC TEMPLATE.

Or maybe @GraphGuy  could get it by SAS/GRAPH .

 

proc template;
define statgraph bihistogram;
begingraph;
entrytitle "Distribution of Height and Weight";
entryfootnote halign=right "SASHELP.HEART";
layout overlay3d / cube=false zaxisopts=(griddisplay=on);
bihistogram3dparm x=height y=weight z=count / display=all  FILLATTRS=graphdata3;
endlayout;
endgraph;
end;
run;
data heart;
set sashelp.heart(keep=height weight);
if height ne . and weight ne .;
height=round(height,5);
weight=round(weight,25);
run;
proc summary data=heart nway completetypes;
class height weight;
var height;
output out=stats(keep=height weight count) N=Count;
run;

proc sgrender data=stats template=bihistogram ;
run;

Ksharp_0-1706778580266.png

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 721 views
  • 3 likes
  • 3 in conversation