BookmarkSubscribeRSS Feed
foxgator
Calcite | Level 5

I have been struggling with 3d histograms using proc template and sgrender.  I have 2 problems:

1) I can't seem to save the graph in true vector format (it will save with a .wmf extension but when opened, it is actually a bitmap)

2) I can't change the tick marks on the z axis. The higher tick marks are outside the data range, but I found documentation that said this wasn't a problem for linear axes only for time axes

here is my code:

proc template;

define statgraph bihistogram1;

  begingraph;

      entrytitle " ";

      layout overlay3d / cube=false  tilt=55

            zaxisopts=(griddisplay=on linearopts=(tickvaluelist=(0 10 20 30 40 50 60 70 80 90 100)))

            xaxisopts=(linearopts=(tickvalueformat=xval.))

            yaxisopts=(linearopts=(tickvalueformat=yval.)) ;

      bihistogram3dparm x=value1 y=value2 z=percent/ display=all;

      endlayout;

  endgraph;

end;

run;

ods graphics on / imagefmt=wmf;

ods listing;

proc sgrender data=kdeplasma2 template=bihistogram1;

      label value1="x" value2="y" percent="Percent";

      title '3d plot of x vs y';

run;

ods graphics off;

ods listing close;

Thanks,

Erin

1 REPLY 1
Jay54
Meteorite | Level 14

You are absolutely right on both counts. 

With SAS 9.2, all graphs are images embedded into EMF or PDF files.

With SAS 9.3, you will get scalable vector graphics output when you request a EMF or PDF output EXCEPT for cases where the graph cannot be rendered by simple vector graphics. This includes 3D graphs and graphs with color gradients and (for emf) transparencies. So in these cases you will get an embedded image. I don't know if we have a way around this yet even for future releases. You should also get a log message.

For 3D axes, you may have found a doc error.  For zaxisopts, we do not support TICKVALUEPRIORITY or VIEWMIN and VIEWMAX (like we do for 2D linear axes).  You can specify the tick values you want, but only the ones that are in the data range will be shown.  We do have plans to add these features in the next release.  The only way I can think you may be able to work around this would be to somehow overlay another fully transparent BiHistogram3DParm (or SurfacePlotParm) with data values up to the range you want. 

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
  • 1 reply
  • 1181 views
  • 3 likes
  • 2 in conversation