BookmarkSubscribeRSS Feed
wbkrebs
Calcite | Level 5

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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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