Graphics Programming

Data visualization using SAS programming, including ODS Graphics and SAS/GRAPH. Charts, plots, maps, and more!
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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 941 views
  • 3 likes
  • 3 in conversation