Is there a way to make a 3D scatter plot in SAS that has more customization and smoother graphics than G3D? A macro for sgplot would be amazing.
I found an older SAS macro (https://blogs.sas.com/content/graphicallyspeaking/2015/03/10/a-3d-scatter-plot-macro/) that doesn't seem to work when I run it in SAS studio.
Many error codes that all seem to do with the following recurring error:
ERROR 251-185: The subroutine MATMULT is unknown, or cannot be accessed. Check your spelling.
Any help to move me towards a publication quality 3d scatter plot would be greatly appreciated.
You can resort to proc iml instead of using matmult which gives you an error.
it requieres a license.
furthermore in sas viya / visual analytics you can use Data-driven content for advanced visualisations.
and another - not tested - possibility is using SAS Viya's open source gateway and run R or python graph libraries which do offer more 3-D visualisations.
Let me play "devil's advocate" a little first ...
Are you 100% certain that a 2d snapshot of one view of a 3d scatter plot is a good way to display/analyze your data? I find that 3d plots often look interesting/fancy, but aren't really good for analytics. Make sure to answer that question, before investing too much time & money on trying to get 3d plots! 🙂
I fully agree with Robert (GraphGuy) about the use of 3D plots to display data. If your data is really 3D, with X, Y and Z variables, then it does make sense to view it in a 3D view. You are really trying to see the shape of the data and not the actual values. The macro does this but adding axis details will only clutter it.
But, if data is 2D, one should avoid trying to view it in 3D just for the "glitz" value. See example:
I found a slightly modified macro (https://github.com/Jiangtang/Programming-SAS/blob/master/ODS/Graphics/3D%20Scatter%20Plot%20Animatio...) that I managed to tweak to my needs and updated a few lines of code for use in SAS studio. The figure is nice looking, but not quite what I need because there are no values on the axes and the axes labels aren't parallel to the axes. Also, the z-axis label cuts off because it is a long variable name.
Any thoughts on how to modify the program to resolve the aesthetics?
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.