I want to output my sgplot using EMFdual. I have tried several different options but the only option that has worked for me so far is:
ods graphics on / noborder;
ods html close ;
ods printer printer=emfplus;
This will print an EMF graph (print from my printer). Other options I have used appear to generate EMF but they are really PNGs. This is obvious when I increase the size of the image. If I can print an EMF, why cant I output it to a file?
Did you try specifing you desired height and width on the ods graphichs options statement?
Otherwise you may have to post a picture to indicate which white space and the procedure used to create it. If you need to do this the PNG style output would be preferable if it looks the same.
PAPERSIZE is not an option for ods graphics. It can affect document margins though.
ods graphics / width=5in height=6in;
You can use any of the measurement units such as cm, mm, pt (printers point) or px (pixels).
Border=off if used corretly should not "distort" image just remove lines around the graphic display area but since border may appear in many places it is hard to guess what may have happened. Frame can be something entirely different and I would have to see the entire syntax you used to guess what may have happened.
If you change the size of the graphics area you may want to consider using NOSCALE option to keep text size from getting enlarged/shrunk in proportion to the graphic display area
ods _all_ close;
ods graphics on / reset=all width=4.5in height=3.0in noborder IMAGEFMT=EMFdual;
ods html close ;
ods printer printer=emfdual;
options nodate nonumber papersize=(4.8in 3.0in);
I still too much white space but the papersize seems to be working. I can not get my grafout or file name to work. Any suggestions on what might work?
This is the error I am getting. It still generates an emf though.
ods _all_ close;
NOTE: ODS PRINTER printed no output.
(This sometimes results from failing to place a RUN
statement before the ODS PRINTER CLOSE statement.)
381 ods graphics on / reset=all width=4.5in height=3.0in
381! noborder IMAGEFMT=EMFdual;
WARNING 1-322: Assuming the symbol EMF was misspelled as
382 filename 'D:\Data\Whitney Parkhouse\SAS Programs\SAS Graph
ERROR: Invalid logical name.
ERROR: Error in the FILENAME statement.
383 ods html close ;
384 ods printer printer=emfdual;
This seems to produce an emf file. SAS does seem to default to png especially with goptions, evem with device=EMF? /* first 64 bytes of graph file */ /* d @ LO `; EMF j Þ */ ods listing style=journal; ods listing gpath='d:/emf'; ods graphics on / width=8in imagefmt=emf imagename="emf"; proc sgplot data=sashelp.class; scatter x=height y=weight / group=sex; run;quit; ods graphics off;
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.