Hi all
A very simple question:
I need to get a histogram in black and white and in eps format
Here is the challenging part.
I am using proc univariate to get the histogram, if I turn ods graphics on to be able to control the image output format (eps), this will override the CFILL order, so the histogram comes out coloured not black and white:
%let gpath='C:\Users\User\Documents\My SAS Files\';
%let dpi=300;
ods listing gpath=&gpath image_dpi=&dpi ;
ods graphics / outputfmt=epsi imagename='Fig1';
proc univariate data=k5;
format inr t.;
histogram INR / cfill=black cbarline=white endpoints=(1 to 9 by 1) ;
run;
If I turn on graphics, I can get the colours the way I want but I cant control the output format
Any solusion for this please?
Maybe using proc template? but I am not that good with GTL
Kind regards
Change your style to JOURNAL.
ODS LISTING STYLE=Journal;
I don't think this will get you exactly what you want but should be closer. The Journal style is for publications and is black and white.
Theres also JOURNAL2.
See the examples linked here, a bit buried albeit.
Thanks Reza
It didnt work, i couldnt save the output as eps: I received the following error
WARNING: HTML4 destination does not support EPSI images. Using the default static format.
NOTE: The graph will be rendered as an image due to the use of transparency.
NOTE: PROCEDURE UNIVARIATE used (Total process time):
real time 0.51 seconds
cpu time 0.34 seconds
Your initial code doesn't mention ODS HTML only LISTING or show an error. In the future please include all relevant information. If something doesn't work, post the full code and log, since doesn't work is a vague term.
The docs do say that EPS is not supported for HTML. Either turn off HTML or use an SVG format instead.
ODS HTML CLOSE;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.